php - Table Row explode with the delimeters comparing it to the other and show it -



php - Table Row explode with the delimeters comparing it to the other and show it -

here code

<?php $split_getcreatedfield = explode(",", "1,5,3"); $fieldswithvalue = explode("~","1->sample 1~3->sample 2~5->sample 3~"); for($c=0;$c<=count($split_getcreatedfield);$c++){ for($b=0;$b<=count($fieldswithvalue)-2;$b++){ $data = explode("->", $fieldswithvalue[$b]); if($data[0]==$split_getcreatedfield[$c]){ echo "<td>"; echo $data[1]; echo "</td>"; } } } ?>

i want output using table

header 1 | header 2 | header 3

sample 1 | sample 2 | sample 3

then if $split_getcreatedfield doesnt match $data[0]

i want output this

header 1 | header 2 | header 3

sample 1 | | sample 3

php html

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -