Last active
May 28, 2020 18:57
-
-
Save rydurham/715a104ed965aae86f28b7d3eaa074c2 to your computer and use it in GitHub Desktop.
Print a PHP array so that it can be copied into source code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
foreach($this->parser->getRecords() as $ref => $record) { | |
echo "'{$ref}' => [\n"; | |
foreach($record as $key => $value) { | |
if (is_float($value)) { | |
echo " '{$key}' => {$value},\n"; | |
} else { | |
echo " '{$key}' => '{$value}',\n"; | |
} | |
} | |
echo "],\n"; | |
} | |
die(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment