Advertisement
touhid_xml

Looping array element in PHP

Sep 7th, 2015
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.22 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.  
  5. $cities = ["Dhaka","Rangpur","Rajshahi","Khulna","Sylhet","Chittagong","Barisal"];
  6. $count = count($cities);
  7.  
  8. //echo $count; exit();
  9.  
  10. for($i = 0; $i<$count; $i= $i+1){
  11.     echo $cities[$i] . "<br />\n";
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement