Forum Moderators: coopster
$array = explode('*',$string);
foreach($array as $arr) {
list($cat,$value) = split(':',$arr);
$newray[] = array($cat => array($value => "text"));}
Can't figure out what I'm doing wrong here. I looked up some tutorials on multidimensional arrays but all I can find are instances where the second value can be text as a key but the first cannot.
Any help is appreciated.
Thanks
$string = "a:bc*1:23*@:@@";
debug($newray,1);
[0] => Array(1)
[a] => Array(1)
[bc] => string 'text'
[1] => Array(1)
[1] => Array(1)
[23] => string 'text'
[2] => Array(1)
[@] => Array(1)
[@@] => string 'text'
what output you expect?
[1][[b]edited by[/b]: NomikOS at 1:25 am (utc) on July 4, 2008][/1]