Answers for "php loop into array"

PHP
1

array push foreach php

$items = array();
foreach($group_membership as $username) {
 $items[] = $username;
}

print_r($items);
Posted by: Guest on September-02-2020
9

foreach loop array php

foreach (array as $value){ 
  //code to be executed; 
  print("value : $value");
} 

foreach (array as  $key => $value){ 
  //code to be executed; 
  print("key[$key] => $value");
}
Posted by: Guest on April-12-2020
1

php loop through array

$letters = ['a','b','c'];
foreach ($letters as $item) {
  echo $item;
}
Posted by: Guest on October-01-2020

Browse Popular Code Answers by Language