note 97497 deleted from function.var-export by danbrown
| From: | danbrown@php.net | Date: | Fri, 23 Apr 2010 00:51:28 +0000 |
| Subject: | note 97497 deleted from function.var-export by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168531@lists.php.net to get a copy of this message | ||
Note Submitter: jason dot lengstorf at ennuidesign dot com
----
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'
)
*/
?>