poe Posted December 3, 2007 Share Posted December 3, 2007 how would i remove the: (http | https | ftp) :// www. from a url if it is present so: http://www.chris.com = chris.com http://chris.com/home.html = chris.com/home.html etc... thanks Quote Link to comment Share on other sites More sharing options...
effigy Posted December 3, 2007 Share Posted December 3, 2007 <pre> <?php $data = <<<DATA http://www.chris.com = chris.com http://chris.com/home.html = chris.com/home.html DATA; echo preg_replace('%(?:https?|ftp)://(?:www\.)?%', '', $data); ?> </pre> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.