PHP string presented as array to array -
$var = "['test', 'test2', 'test3']";
how create workable array in php?
i've tried explode($var, ","); didn't seem work, unless went wrong attempt.
explode($var, ",");
wrong. explode
needs first argument delimiter , second string. replace []
, explode
-
$var = "['test', 'test2', 'test3']"; $var = str_replace(array('[', ']'), '', $var); $arr = explode(',', $var);
Comments
Post a Comment