note 96023 added to function.print-r

From: Date: Wed, 03 Feb 2010 18:01:43 +0000
Subject: note 96023 added to function.print-r
Groups: php.notes 
Request: Send a blank email to php-notes+get-165633@lists.php.net to get a copy of this message
I add this function to the global scope on just about every project I do, it makes reading the output of print_r() in a browser infinitely easier. <?php function print_r2($val){ echo '<pre>'; print_r($val); echo '</pre>'; } ?> It also makes sense in some cases to add an if statement to only display the output in certain scenarios, such as: if(debug==true) if($_SERVER['REMOTE_ADDR'] == '127.0.0.1') ---- Server IP: 69.147.83.197 Probable Submitter: 142.55.244.246 ---- Manual Page -- http://www.php.net/manual/en/function.print-r.php Edit -- https://master.php.net/note/edit/96023 Del: integrated -- https://master.php.net/note/delete/96023/integrated Del: useless -- https://master.php.net/note/delete/96023/useless Del: bad code -- https://master.php.net/note/delete/96023/bad+code Del: spam -- https://master.php.net/note/delete/96023/spam Del: non-english -- https://master.php.net/note/delete/96023/non-english Del: in docs -- https://master.php.net/note/delete/96023/in+docs Del: other reasons-- https://master.php.net/note/delete/96023 Reject -- https://master.php.net/note/reject/96023 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#165633) next »