Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function strip_domain($url = '')
- {
- return preg_replace('/^http(s)?:\/\/([^\/]+).*$/', "$2", $url);
- }
- print_r(strip_domain('http://www.youtube.com/watch?v=kEvRlU6S9s8&feature=kp'));
- // will print www.youtube.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement