@FarOut :
You're entirely right. "proper" wasn't the right word, i would mean.. mh.. well, i don't have enought word to explain my opinion.
Write a variable on several lines, it confused me, i prefer write it only in one line, even if it's not really eye-friendly. But i guess that's not the same thing for everyone .
But you're right about \n, which does exactly the same job as chr(10).
I don't like the type conversion, so, i prefer use chr(10).
Note that \n is more optimized than heredoc, for the time execution.
Well, it's always interesting to see different manners to do the same thing
You're entirely right. "proper" wasn't the right word, i would mean.. mh.. well, i don't have enought word to explain my opinion.
Write a variable on several lines, it confused me, i prefer write it only in one line, even if it's not really eye-friendly. But i guess that's not the same thing for everyone .
But you're right about \n, which does exactly the same job as chr(10).
PHP Code:
<?php
//Output 10
echo ord("\n");
?>
Quote:Sorry, I kinda rambled there. In short, chr() should definitely not be used for implementing newlines within a string ;).Well, in general it's true. "\n" is sometimes considerate as a string, and not a newline.
PHP Code:
<?php
// Output 10
echo ord("\n");
// Output 92
echo ord('\n');
?>
Note that \n is more optimized than heredoc, for the time execution.
Well, it's always interesting to see different manners to do the same thing