Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php iterate through array

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

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

iterate through an associative array php

<?php 
$freelancer = array( 
    "name" => "Eric", 
    "email" => "Eric@gmail.com", 
    "age" => 22, 
    "gender" => "male"
); 
  
// Loop through employee array 
foreach($freelancer as $key => $value) { 
    echo $key . ": " . $value . "<br>"; 
} 
?>
Comment

PREVIOUS NEXT
Code Example
Php :: laravel use session values in view 
Php :: install php 5.6 on ubuntu 18.04 
Php :: save an image use php 
Php :: join in laravel eloquent 
Php :: create char laravel migration 
Php :: header refresh page php 
Php :: calculate 18 years back date in php 
Php :: get substring after character php 
Php :: store image to s3 laravel 
Php :: how validate the becrypt password in laravel 
Php :: codeingiter 3 where in 
Php :: php move file to another directory 
Php :: Notice: Trying to access array offset on value of type int in /var/www/pdam/modules/phpexcel/PHPExcel/Cell/DefaultValueBinder.php on line 82 
Php :: storage in laravel 
Php :: ternary operator in php 
Php :: download html content from url php 
Php :: iterating rows in php 
Php :: PHP mysqli_close function 
Php :: how to remove null values in array php 
Php :: laravel controller store 
Php :: Clear php cache 
Php :: hasone relation in laravel 
Php :: check if object has method php 
Php :: eloquent pluck multiple columns 
Php :: redirect compact laravel 
Php :: laravel online hash password generator 
Php :: string to array in php 
Php :: json_encode() in php 
Php :: genrate file name in php 
Php :: select sum laravel 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =