php - String to array conversion if string has content like an array -
i have this:
array('fields' => array( 0 => array('name' => 'family_name', 'label' => 'family names'), array('name' => given_names', 'label' => 'given names'), array('name' => 'additional_names', 'label' => 'additional names'), array('name' => 'honorific_prefixes', 'label' => 'honorific prefixes'), array('name' => honorific_suffixes', 'label' => 'honorific suffixes') ) )
in variable string. whole thing in 1 database field. if output variable, string. have array content subarrays. how convert value array?
i searched google, found explode , split , on, think miss key word find solution.
thank in case.
try using eval(), https://secure.php.net/manual/en/function.eval.php
eval("\$array = $string;"); print_r($array);
Comments
Post a Comment