Signatur
var_export(mixed $value, bool $return = false): ?string
Beschreibung
Perfekt für Config-Files oder Cache-Dumps.
Parameter
| Name | Typ | Default | Beschreibung |
|---|---|---|---|
| $value Pflicht | mixed | — | Wert. |
| $return | bool | false | Als String. |
Rückgabewert
Typ
?string
Beschreibung
String oder null.
Beispiele
Config schreiben
<?php
$php = '<?php return ' . var_export($config, true) . ';';
file_put_contents('config.php', $php);