Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

sds

By: a guest on Apr 3rd, 2013  |  syntax: None  |  size: 0.28 KB  |  views: 102  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $cities = array('Tokyo', 'Mexico City', 'New York City', 'Mumbai', 'Seoul', 'Shanghai', 'Lagos', 'Buenos Aires', 'Cairo', 'London');
  2.                
  3.                 echo "<h2>Array to string separated by comma</h2><br>";
  4.                 foreach ($cities as $result) { 
  5.                     $string = $result. ', ';
  6.                         echo $string;
  7.                 }