On Fri, Aug 29, 2008 at 11:25 AM, Ron Piggott <[EMAIL PROTECTED]>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."

Reply via email to