note 40228 added to ref.variables
| From: | postings-php-manual at hans-spath dot de | Date: | Thu, 26 Feb 2004 02:10:36 +0000 |
| Subject: | note 40228 added to ref.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65767@lists.php.net to get a copy of this message | ||
colored var_export:
<?
function my_var_export_hl( $mixed, $ret=false ) {
return highlight_string( '<? '.var_export($mixed,true), $ret );
} ?>
+ looks nice
+ HTML code in $mixed will be escaped correctly for output
- returned string is no valid php code, so don't use it in eval()
Example:
<? my_var_export_hl( array('key'=>NULL,
1=>array(false,"\xFF",'<i>')) ); ?>
Output (colored!):
<? array (
'key' => NULL,
1 =>
array (
0 => false,
1 => 'ÿ',
2 => '<i>',
),
)
----
Manual Page -- http://www.php.net/manual/en/ref.variables.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40228
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40228&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40228&report=yes
Search -- http://master.php.net/manage/user-notes.php