Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to sort with array and after print by for loop in php

$cars = array("Volvo", "BMW", "Toyota");
sort($cars);

$clength = count($cars);
for($x = 0; $x < $clength; $x++) {
  echo $cars[$x];
  echo "<br>";
}
 
PREVIOUS NEXT
Tagged: #sort #array #print #loop #php
ADD COMMENT
Topic
Name
2+5 =