Let's say I have an string like
$str = "BKL|bkl,EXH|exh,FFV|ffv,LEC|lec,AUE|aue,SEM|SEM";
and i want an array like:
array( array("title"=>"BKL", "value"=>bkl),
array("title"=>"EXH", "value"=>exh),
array("title"=>"FFV", "value"=>ffv),
array("title"=>"LEC", "value"=>lec),
array("title"=>"AUE", "value"=>aue),
array("title"=>"SEM", "value"=>SEM),
);
I have found a solution here: How to create particular array from string in php but this is giving me an array like:
Array
(
[BKL] => bkl
[EXH] => exh
[FFV] => ffv
[LEC] => lec
[AUE] => aue
[SEM] => sem
)
Thanks a lot.