preg_split.php

Source of preg_split.php

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>preg_split.html</title>
</head>
<body>
  <h1>Using preg_split</h1>
  <?php
    $theString = "joe@somewhere.net";
    $theArray = preg_split("/[@\.]/", $theString);
    print "<pre>\n";
    print_r($theArray);
    print "</pre>\n";
  ?>
  </body>
</html>