PHP Tutorial : Parse/split url and get components

Hello folks,
My question is : how do you split and get an URL to get his components? If you’re using all kind of functions, regular expressions or whatever, here is the save and original function you’ll need and it’ll do your job : parse_url() php function. Look how simple is:

<?php
$url = "http://www.crivionweb.com/phpblog/";
print_r(parse_url($url));
?>
This entry was posted in Basic PHP and tagged , , , . Bookmark the permalink.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>