title: PHP preg_split: Split string by forward slash
body: <p>I want to split my string <code>192.168.1.1/24</code> by forward slash using PHP function <strong><a href="http://php.net/manual/fr/function.preg-split.php" rel="noreferrer">preg_split</a></strong>.</p>
  
  <p><strong>My variable :</strong></p>
  
  <pre><code>$ip_address = "192.168.1.1/24";
  </code></pre>
  
  <p><strong>I have tried :</strong></p>
  
  <pre><code>preg_split("/\//", $ip_address); 
  //And
  preg_split("/[/]/", $ip_address); 
  </code></pre>
  
  <blockquote>
    <p><strong>Error message :</strong> preg_split(): Delimiter must not be alphanumeric or backslash</p>
  </blockquote>
  
  <p>I found the following answer here in stackoverflow <strong><a href="https://stackoverflow.com/questions/17775374/php-preg-split-for-forwardslash">Php preg_split for forwardslash?</a></strong>, but it not provide a direct answer.</p>