miriamn Posted August 14, 2008 Share Posted August 14, 2008 Hi, I know Perl , starting to work with PHP. I want to put a very long string into a variable, I don’t want to write the string in a very long line. (for readability…) I want to “break” the line without breaking the assignment to the variable. In Perl, I’m doing something like: $var =<< HTML; here is the text…. here is the text…. here is the text…. here is the text…. HTML ( instead of : $var =” here is the text…. here is the text…. here is the text….here is the text…. “; ) Is there something similar in PHP? Thanks, Miriam. Link to comment https://forums.phpfreaks.com/topic/119618-break-line-without-breaking-the-assignment/ Share on other sites More sharing options...
dbo Posted August 14, 2008 Share Posted August 14, 2008 Did you try: $variable = " this is a long one? "; Link to comment https://forums.phpfreaks.com/topic/119618-break-line-without-breaking-the-assignment/#findComment-616387 Share on other sites More sharing options...
448191 Posted August 14, 2008 Share Posted August 14, 2008 You can do pretty much the same as you do in Perl in PHP. It's called Heredoc syntax. And, surprise, surprise, it is actually in the manual... http://nl3.php.net/manual/en/language.types.string.php Btw, moving to PHP Help, this has nothing to with Application Design... Link to comment https://forums.phpfreaks.com/topic/119618-break-line-without-breaking-the-assignment/#findComment-616788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.