topical media & game development

talk show tell print

basic-regex-23-preg-split.php / php



  <html>
  <head>
  <title>A preg_split() Example</title>
  </head>
  <body>
  <?php
  myCSV = "Oranges, Applies, Bananas, Kiwi Fruit, Mangos";
  myArray = preg_split("/,/", myCSV);
  echo "<p>The original string was: 'myCSV'.</p>";
  echo "<p>After splitting the array contains the following values:</p.><br />";
  print_r(array_values(myArray));
  ?>
  </body>
  </html>


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.