Re: Checking for http://

From: Date: Fri, 29 Aug 2008 15:33:30 +0000
Subject: Re: Checking for http://
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-278971@lists.php.net to get a copy of this message
On Fri, Aug 29, 2008 at 11:25 AM, Ron Piggott <ron.php@actsministries.org>wrote: > How do I check if http:// is at the beginning of $web_site and > if it > isn't add it? Ron > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > You could use substr() (www.php.net/substr) if ( substr( $web_site, 0, 7 ) != "http://" ) { $web_site = "http://" . $web_site; } -- -Dan Joseph www.canishosting.com - Plans start @ $1.99/month. "Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life."

« previous php.general (#278971) next »