note 20183 added to function.ereg-replace

From: Date: Mon, 25 Mar 2002 23:11:44 +0000
Subject: note 20183 added to function.ereg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-28194@lists.php.net to get a copy of this message
I tried the expression from miha@sonce.net, but it was problematic because it assumes that you have a full URL. I needed to check user form data and strip out the protocol and server name if present. This worked for me: $newurl = eregi_replace("^(http://)[^/]+/", "", $url); -- http://www.php.net/manual/en/function.ereg-replace.php http://master.php.net/manage/user-notes.php?action=edit+20183 http://master.php.net/manage/user-notes.php?action=delete+20183 http://master.php.net/manage/user-notes.php?action=reject+20183

« previous php.notes (#28194) next »