I have a string composed like this:
87||1|nuovo#88||4|#209|||#89|||#41||1|#5|||#3||1|116#20|||#13||3|#148|||
The pattern is:
Id1|Mq1|Q.ta1|Tipo1#Id2|Mq2|Q.ta2|Tipo2#Id3|Mq3|Q.ta3|Tipo3
and so on...
Basically each item has 4 attributes separated by "|" and each item is separated by "#"
I'd need to explode the string to have single variables for each item's attributes.
As for now I'm here:
<?php
$str = "87||1|nuovo#88||4|#209|||#89|||#41||1|#5|||#3||1|116#20|||#13||3|#148|||#36|||91#29|||68";
$caratteristica = print_r (explode("#",$str));
?>
Which gave me this result:
Array ( [0] => 87||1|nuovo [1] => 88||4| [2] => 209||| [3] => 89||| [4] => 41||1| [5] => 5||| [6] => 3||1|116 [7] => 20||| [8] => 13||3| [9] => 148||| [10] => 36|||91 [11] => 29|||68 )
I'd need four variables for each element of this array
( something like $id[], $mq[],$qt[],$tipo[]
).