I have custom cms database and get parameter from database and my result this is:
$param = 'param1="value1"|param2="value2"|param3="value3"|param4="value4"|param5="value5"'
but I need get param1 value or other value. I try use explode but my result this is:
$string = explode('|',$param);
result:
array (size=4)
0 => string 'param1="value1"'
1 => string 'param2="value2"'
2 => string 'param3="value3"'
3 => string 'param4="value4"'
4 => string 'param5="value4"'
I need get value this format:
$param->param1 = value1;
array('value1', 'value2' ....)??parse_str(str_replace('|', '&', $param), $paramArray);perhaps? And you can then cast$paramArrayto an object,$params = (object) $paramArray;