Answers for "php loop through array number and get that arrays key values"

PHP
1

loop through values of hash php

foreach ($array as $key => $val) {
    print "$key = $val\n";
}
Posted by: Guest on February-16-2020
0

create pair foreach item in array

arr = [1, 2, 3, 4];

function pairwise(arr, func){
    for(var i=0; i < arr.length - 1; i++){
        func(arr[i], arr[i + 1])
    }
}

pairwise(arr, function(current, next){
    console.log(current, next)
})
Posted by: Guest on October-10-2020

Code answers related to "php loop through array number and get that arrays key values"

Browse Popular Code Answers by Language