my array this:
$x= array( [0] => array ( [0] => id [1] => 15 [2] => 0 ) [1] => array ( [0] =>names [1] => 5 [2] => 1 ) ) i want write statement says if value of key[0]== id, something; else if value of key[0]== names, else.
there way can that?
thanks.
use foreach loop
foreach($x $key){ if ($key[0] == 'id') { echo "your id code here"; } else if ($key[0] == 'names') { echo "your names code here"; } }
Comments
Post a Comment