$array = array("Jonathan","Sampson");
foreach($array as $value) {
print $value;
}
or
$length = count($array);
for ($i = 0; $i < $length; $i++) {
print $array[$i];
}
More Related Contents:
- What is the best way to loop through this array in PHP?
- PHP Foreach Pass by Reference: Last Element Duplicating? (Bug?) [duplicate]
- How do you remove an array element in a foreach loop?
- PHP hierarchical array – Parents and childs
- Looping a multidimensional array in php
- Checking if array is multidimensional or not?
- How do i count same values in an array and store it to a variable?
- PHP foreach loop through multidimensional array [duplicate]
- Loop a multidimensional array and only print two specific column values per row
- case-insensitive array_unique
- Insert elements from one array (one-at-a-time) after every second element of another array (un-even zippering)
- How to set an option from multiple options or array with different values to views as selected in select box using PHP
- Twig for loop for arrays with keys
- PHP multidimensional array search by value
- How to sum all column values in multi-dimensional array?
- How to convert JSON string to array
- Modify array values in foreach loop
- How to execute two mysql queries as one in PHP/MYSQL?
- Build a tree from a flat array in PHP
- Cartesian Product of N arrays
- Sort an array by a child array’s value in PHP
- Convert flat array to the multi-dimensional
- Is there a way to fetch associative array grouped by the values of a specified column with PDO?
- Using usort in php with a class private function
- php – get numeric index of associative array
- Converting an array from one to multi-dimensional based on parent ID values
- What causes: “Notice: Uninitialized string offset” to appear? [closed]
- Get most recent date from an array of dates in “Y-m-d H:i:s” format
- Loop over DOMDocument
- How to count the consecutive duplicate values in an array?