note 97497 added to function.var-export
| From: | jason dot lengstorf at ennuidesign dot com | Date: | Fri, 23 Apr 2010 00:18:05 +0000 |
| Subject: | note 97497 added to function.var-export | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-168530@lists.php.net to get a copy of this message | ||
In response to john dot risken at gmail dot com, there's an easier way to keep formatting when
printing the return of var_export() to an HTML page:
<?php
// A sample array
$myArray = array(
'foo' => 'bar',
'bat' => 'baz'
);
// Wrap the output in pre tags to preserve formatting
echo "<pre>", var_export($myArray, TRUE), "</pre>";
/*
Formatting remains intact on an HTML page:
array(
'foo' => 'bar',
'bat' => 'baz'
)
*/
?>
----
Server IP: 208.69.120.55
Probable Submitter: 72.174.1.124
----
Manual Page -- http://www.php.net/manual/en/function.var-export.php
Edit -- https://master.php.net/note/edit/97497
Del: integrated -- https://master.php.net/note/delete/97497/integrated
Del: useless -- https://master.php.net/note/delete/97497/useless
Del: bad code -- https://master.php.net/note/delete/97497/bad+code
Del: spam -- https://master.php.net/note/delete/97497/spam
Del: non-english -- https://master.php.net/note/delete/97497/non-english
Del: in docs -- https://master.php.net/note/delete/97497/in+docs
Del: other reasons-- https://master.php.net/note/delete/97497
Reject -- https://master.php.net/note/reject/97497
Search -- https://master.php.net/manage/user-notes.php