Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

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


{filelink=13366}

<?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];
?>

No comments yet.

Leave a Comment