But prior PHP 7, you can maybe do this, using a constant to pass an array elsewhere with define:
Code: Select all
$to_define_array = serialize($array);
define( "DEFINEANARRAY", $to_define_array );
Code: Select all
$serialized = DEFINEANARRAY; // passing directly the defined constant to unserialize() will not work
$our_array = unserialize($serialized);
print_r($our_array);