Print respective index value from two arrays in " Javascript " and in " PHP "

user7429130

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

oetoni

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to print elements and values from two related associative arrays in PHP

From Dev

php get the same index values from two arrays (outside foreach)

From Dev

Join two javascript arrays at index

From Dev

Unable to print items from two arrays in intervals

From Dev

print common elements from two arrays

From Dev

Compare two arrays with their respective directories in shell script?

From Dev

How do I sum the respective elements of two arrays into another array in Javascript?

From Dev

find the max value of column 1 and print respective record from column 2 from file

From Dev

PHP - merge two arrays using index but remove extras from second array

From Dev

Print Value from specific index in backward

From Dev

PHP splitting array into two arrays based on value

From Dev

PHP merge two arrays on the same key AND value

From Dev

PHP splitting array into two arrays based on value

From Dev

Checking if a value exists in two or more arrays in php

From Dev

Value selection between two Arrays in Javascript

From Dev

Print two arrays side by side in a multidimensional array Javascript

From Dev

Get computed value from two observable arrays

From Dev

javascript extract id's from two levels of arrays for key value pairs in new object

From Dev

Bash - Check if two files exist and print their respective filename for the existing ones

From Dev

Return two separate arrays from an object in JavaScript

From Dev

Creating a JavaScript Object from two arrays

From Dev

Merging only respective elements of two arrays in one array in ruby

From Dev

Find Index where Two Arrays have same Value

From Dev

print checked checkbox value from FORM in php?

From Dev

print object value from XML in PHP

From Dev

How to get a value from arrays with php

From Dev

php need to sort arrays in array and get respective key

From Dev

matlab: find the index of common values at the same entry from two arrays

From Dev

how to scan null index in array, and print it with a new value in php?

Related Related

  1. 1

    How to print elements and values from two related associative arrays in PHP

  2. 2

    php get the same index values from two arrays (outside foreach)

  3. 3

    Join two javascript arrays at index

  4. 4

    Unable to print items from two arrays in intervals

  5. 5

    print common elements from two arrays

  6. 6

    Compare two arrays with their respective directories in shell script?

  7. 7

    How do I sum the respective elements of two arrays into another array in Javascript?

  8. 8

    find the max value of column 1 and print respective record from column 2 from file

  9. 9

    PHP - merge two arrays using index but remove extras from second array

  10. 10

    Print Value from specific index in backward

  11. 11

    PHP splitting array into two arrays based on value

  12. 12

    PHP merge two arrays on the same key AND value

  13. 13

    PHP splitting array into two arrays based on value

  14. 14

    Checking if a value exists in two or more arrays in php

  15. 15

    Value selection between two Arrays in Javascript

  16. 16

    Print two arrays side by side in a multidimensional array Javascript

  17. 17

    Get computed value from two observable arrays

  18. 18

    javascript extract id's from two levels of arrays for key value pairs in new object

  19. 19

    Bash - Check if two files exist and print their respective filename for the existing ones

  20. 20

    Return two separate arrays from an object in JavaScript

  21. 21

    Creating a JavaScript Object from two arrays

  22. 22

    Merging only respective elements of two arrays in one array in ruby

  23. 23

    Find Index where Two Arrays have same Value

  24. 24

    print checked checkbox value from FORM in php?

  25. 25

    print object value from XML in PHP

  26. 26

    How to get a value from arrays with php

  27. 27

    php need to sort arrays in array and get respective key

  28. 28

    matlab: find the index of common values at the same entry from two arrays

  29. 29

    how to scan null index in array, and print it with a new value in php?

HotTag

Archive