nowdoc Questions
7
Solved
I've already found some solutions, but can't know what happened...
Example 1:
<?php
echo <<< EOD
test
EOD;
Example 2:
<?php
echo <<< 'EOD'
test
EOD;
Output 1,2:
PH...
4
Solved
As a newbie, I have been advised to preferably use heredoc compared to too many nested codes (see Unexpected T_ELSE in php code).
But I can't manage to understand if there is a significant differe...
2
Solved
I'm trying to use sprintf on a heredoc this way. It wont work. Any idea how to solve this?
$i = <<<EOD
This is your invoice for %1$s %1$s %1$s %1$s
EOD;
$year = '2013';
$i = sprintf($i,$...
1
© 2022 - 2024 — McMap. All rights reserved.