CHALLENGE: how to interpolate constants and variables in PHP double-quoted strings and "heredocs". | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 2

CHALLENGE: how to interpolate constants and variables in PHP double-quoted strings and "heredocs".

You can easily interpolate variables in PHP double-quoted strings and "heredocs", but constants, functions and mathematical operations are normally not Algerier allowed. The only usual way is string concatenation, but the result can be messy (and it's not possible with 'heredocs'). I've come with a solution below. Does anyone has a better one?

17th Feb 2018, 9:08 PM
Bruno Della Motta
Bruno Della Motta - avatar
1 ответ
17th Feb 2018, 9:09 PM
Bruno Della Motta
Bruno Della Motta - avatar