Fruits-banana|apple|orange:Food-fries|sausages:Desserts-ice cream|apple pie
satırına sahibim :
(kolon) ana konu için ayırıcıdır ve |
farklı alt konular için ayırıcıdır.
Patlatmaya çalıştım ve diziye koydum, sonuç olarak aşağı açılır menüde görüntülenecek bir sonuca ihtiyacım var: -
Fruits banana apple orange Food fries sausages
$result=explode(":",$data);
foreach($result as $res) {
$sub_res[]=explode("-",$res);
}
foreach($sub_res as $sub) {
//echo $sub[1]."<br>"; Over here, I can get the strings of [0]=>banana|apple|orange, [1]=>sausages|fries,
// I explode it again to get each items
$items[]=explode("|",$sub[1]);
$mainCategory[]=$sub[0]; // This is ([0]=>Fruits, ]1]=>Food, [2]=>dessert
// How do I assign the $items into respective categories?
}
Teşekkürler!
kategoriler? – Kel
Bu çizgiyi nereden aldınız? –
Hepsi için tek bir açılır menüye mi yoksa her tür için ayrı bir açılırma mı ihtiyacınız var? – Jason