robbster Posted March 5, 2008 Share Posted March 5, 2008 Hi, Is there a php equivalent of <<END in perl? In perl I'd say print FILEHANDLE <<END; This is a test bla bla END And that text would be written in some file. I want to do this in php. Any ideas? I'm creating an html file on the fly and I don't want to assign my html code to say $x and then say fwrite($handle,$x); or backslash all the double quotes and single quotes. Anyone have any ideas someone can share? Thanks. Link to comment https://forums.phpfreaks.com/topic/94597-php-equivalent-of/ Share on other sites More sharing options...
KrisNz Posted March 6, 2008 Share Posted March 6, 2008 Do you mean heredoc syntax? e.g <?php echo <<<END <b>this is some html with quotes' ' '' "" '"'' and stuff.</b> END; ?> Link to comment https://forums.phpfreaks.com/topic/94597-php-equivalent-of/#findComment-484453 Share on other sites More sharing options...
robbster Posted March 7, 2008 Author Share Posted March 7, 2008 Thank You! Link to comment https://forums.phpfreaks.com/topic/94597-php-equivalent-of/#findComment-485669 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.