note 74214 added to function.print
| From: | mvpetrovich at osu1 dot php dot net | Date: | Fri, 30 Mar 2007 07:02:50 +0000 |
| Subject: | note 74214 added to function.print | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124941@lists.php.net to get a copy of this message | ||
I grew quite tired of backslashes, and wrote these routines. It uses the back single quote as a
substitute for double quotes within a statement. It made my code much more readable. It is a
little easier than using a "here document." I also found I make a few less typing errors.
<?php
function qq($text) {return str_replace('`','"',$text); }
function printq($text) { print qq($text); }
function printqn($text) { print qq($text)."\n"; }
//example - before
echo "<a href=\"#\" class=\"stdbutton\" style=\"float:left;\"
onclick=\"myfunction(); return false;\">My Link</a>\n";
//becomes - with printqn function
printqn("<a href=
# class=stdbutton style=float:left;
onclick=myfunction(); return false;>My Link</a>");
?>
----
Server IP: 216.194.113.175
Probable Submitter: 24.20.177.246
----
Manual Page -- http://www.php.net/manual/en/function.print.php
Edit -- https://master.php.net/note/edit/74214
Del: integrated -- https://master.php.net/note/delete/74214/integrated
Del: useless -- https://master.php.net/note/delete/74214/useless
Del: bad code -- https://master.php.net/note/delete/74214/bad+code
Del: spam -- https://master.php.net/note/delete/74214/spam
Del: non-english -- https://master.php.net/note/delete/74214/non-english
Del: in docs -- https://master.php.net/note/delete/74214/in+docs
Del: other reasons-- https://master.php.net/note/delete/74214
Reject -- https://master.php.net/note/reject/74214
Search -- https://master.php.net/manage/user-notes.php