Print respective index value from two arrays in " Javascript " and in "PHP"
var a = [ x , y , z]
var b = [ p, q, r]
then => values [x, p] , [ y, q]
please help me, Thanks you
or just straight forward:
x=[ "x" , "y" , "z"];
y=[ "p" , "q" , "r"];
for (var i = 0; i < x.length; ++i) {
alert('value at index [' + i + '] is: [' + x[i] + '] and [' + y[i] + ']');
}
as per comment in PHP:
$x= array("x" , "y" , "z");
$y= array("p" , "q" , "r");
for ($i = 0; $i < count($x); ++$i) {
echo $x[$i];
echo $y[$i];
}
also check this excellent answer here
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments