array in array php foreach
$clothes = array("hat","shoe","shirt");
foreach ($clothes as $item) {
echo $item;
}<?php
$arr = array(1, 2, 3, 4);
foreach ($arr as &$value) {
$value = $value * 2;
}
// $arr is now array(2, 4, 6, 8)
unset($value); // break the reference with the last element
?>
<?php
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
foreach($age as $x => $val) {
echo "$x = $val<br>";
}
?>
Also in PHP:
- add days with dates php
- Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 126976 bytes) in
- check if string include char php
- codeigniter delete record by id
- Str slug laravel
- adeleye ayodeji
- code cache laravel
- Format Month as a number php
- .catch php
- drupal/core 8.9.7 requires ext-dom * -> the requested PHP extension dom is missing from your system. composer install
- factoring and seeding in laravel
- codeigniter echo last query
- encontrar una palabra dentro de una cadena php
- check if key_exists php
- check my version of composer
- codeigniter get last insert
- check if string contains substring php
- change time format in php
- check data type in php
- 12:30 am time format validation in laravel
- can php date be echoed as string
- What was the old name of PHP?
- day in php time
- Backend fatal error: PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted in laravel 8