“ForEach PHP” Código de respuesta

JavaScript foreach

const avengers = ['thor', 'captain america', 'hulk'];
avengers.forEach((item, index)=>{
	console.log(index, item)
})
connect.sonveer

recorrer los valores del hash php

foreach ($array as $key => $val) {
    print "$key = $val\n";
}
Important Impala

bucle de matriz PHP

for ($i = 0; $i < count($array); $i++) {
    echo $array[$i]['filename'];
    echo $array[$i]['filepath'];
}
Clever Cardinal

PHP foreach

$arr = ['Item 1', 'Item 2', 'Item 3'];

foreach ($arr as $item) {
  var_dump($item);
}
garzj

bucle foreach en php

<?php
$arr = ['Item 1', 'Item 2', 'Item 3'];

foreach ($arr as $item) {
  var_dump($item);
}

$dict = array("key1"=>"35", "key2"=>"37", "key3"=>"43");

foreach($dict as $key => $val) {
  echo "$key = $val<br>";
}
?>
The.White.Fang

ForEach PHP

<?php
$array = [
    [1, 2],
    [3, 4],
];

foreach ($array as list($a, $b)) {
    echo "A: $a; B: $b; C: $c\n";
}
?>
Mysterious Marten

Respuestas similares a “ForEach PHP”

Preguntas similares a “ForEach PHP”

Más respuestas relacionadas con “ForEach PHP” en PHP

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código