note 90740 deleted from function.print by danbrown

From: Date: Thu, 07 May 2009 14:00:04 +0000
Subject: note 90740 deleted from function.print by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-154316@lists.php.net to get a copy of this message
Note Submitter: green dot timothy dot SPAMFILTER at gmail dot com ---- mvpetrovich, who was tired of backslashes to escape his code blocks, would probably be better served by simply enclosing his strings in single quotes instead. <?php echo "<a href=\"#\" class=\"stdbutton\" style=\"float:left;\" onclick=\"myfunction(); return false;\">My Link</a>\n"; ?> becomes <?php echo '<a href="#" class="stdbutton" style="float:left;" onclick="myfunction(); return false;">My Link</a>' . PHP_EOL; ?> Significantly easier. And also easier than using those funny quotes he chose to use. Faster code to run, too, if that bothers you. Actually, since I use "end of line" quite a lot for pretty-printing HTML, it's worth defining it as something shorter: <?php define('CR', PHP_EOL); // carriage return ?>

« previous php.notes (#154316) next »