PHP Displaying Elements Of $Regs Array – String Function

<?
$url = "http://www.w3mentor.com";$www_url = ereg("^(http://www)\.([[:alnum:]]+)\.([[:alnum:]]+)", $url, $regs);if ($www_url) :
     echo $regs[0];
     print "<br />";
     echo $regs[1];
     print "<br />";
     echo $regs[2];
     print "<br />";
     echo $regs[3];
endif;
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.