List Info

Thread: note 74214 added to function.print




note 74214 added to function.print
user name
2007-03-30 02:02:50
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  -- h
ttps://master.php.net/note/delete/74214/integrated
Del: useless     -- http
s://master.php.net/note/delete/74214/useless
Del: bad code    -- htt
ps://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     -- http
s://master.php.net/note/delete/74214/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/74214
Reject      -- https://mast
er.php.net/note/reject/74214
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )