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

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -