Expression Régulière: Découper un URL

Author:


Download

<?php
   $url = "http://www.exemple.com";

   morceaux = ereg("^(http://www).([[:alnum:]]+).([[:alnum:]]+)", $url, $regs);

   echo $regs[0];
   echo "<br>";
   echo $regs[1];
   echo "<br>";
   echo $regs[2];
   echo "<br>";
   echo $regs[3];
?>

Leave a Reply

Your email address will not be published. Required fields are marked *


− four = 5