I need to explode by "," then ":". Easy enough...
$alttitle = "35:title1,36:title2, 59:title5"
$replacetitles = explode(",",$alttitle);
for ($i = 0 ; $i < count($replacetitles) ; $i++) {
$replacetitle[] = explode(":", $replacetitles[$i]);
}
Which produces...
Array ( [0] => Array ( [0] => 35 [1] => title1 ) [1] => Array ( [0] => 36 [1] => title2 ) [2] => Array ( [0] => 59 [1] => title5 ) )
...but the number 35,36,59 are unique so I want this to become the key for the array?
Array ( [35] => title1 [36] => title2 [59] => title5 )