note 108457 added to function.print
| From: | at iamphilrae | Date: | Fri, 27 Apr 2012 14:56:15 +0000 |
| Subject: | note 108457 added to function.print | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187380@lists.php.net to get a copy of this message | ||
A little improvement to the println() function from August 2008. This one includes a check to see
if the function exists (better safe than sorry should PHP include this function in the future), and
includes the ability to add blank lines to before of after the string:
if(!function_exists('println')) {
function println($string_message = '', $before=0, $after=0) {
$break = isset($_SERVER['SERVER_PROTOCOL']) ? "<br />".PHP_EOL :
PHP_EOL;
$out = '';
for(; $before>0; $before--)
$out .= $break;
$out .= $string_message.$break;
for(; $after>0; $after--)
$out .= $break;
return print($out);
}
}
----
Server IP: 87.124.126.48
Probable Submitter: 81.137.199.102
----
Manual Page -- http://www.php.net/manual/en/function.print.php
Edit -- https://master.php.net/note/edit/108457
Del: integrated -- https://master.php.net/note/delete/108457/integrated
Del: useless -- https://master.php.net/note/delete/108457/useless
Del: bad code -- https://master.php.net/note/delete/108457/bad+code
Del: spam -- https://master.php.net/note/delete/108457/spam
Del: non-english -- https://master.php.net/note/delete/108457/non-english
Del: in docs -- https://master.php.net/note/delete/108457/in+docs
Del: other reasons-- https://master.php.net/note/delete/108457
Reject -- https://master.php.net/note/reject/108457
Search -- https://master.php.net/manage/user-notes.php