Re: [PHP] Checking for http://



On Fri, Aug 29, 2008 at 11:25 AM, Ron Piggott <ron.php@xxxxxxxxxxxxxxxxxx>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."


Relevant Pages

  • Re: what is etymology? (linguistics and biology)
    ... Upon entering the Lascaux cave via the ancient ... As CER PIR, stag fire, he protected the ... Ancient Greek keraunos means flash, ... him or her warm. ...
    (sci.lang)
  • Re: Good Morning
    ... >> It is cold in this house when I wake up. ... fire requires certain things to get going. ... this way of getting warm takes a while. ... >> I am grateful I have a house and a stove and wood to burn. ...
    (alt.gathering.rainbow)
  • Re: sony sucks
    ... mostly into gaming of the style that I grew up with -- early to mid-80's games) but even I've bought a few things from lik-sang. ... "Build a man a fire, and he'll be warm for a day. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: [PHP] Re: SOAP - return a list of items
    ... -Dan Joseph ... "Build a man a fire, and he will be warm for the rest of the day. ... and will be warm for the rest of his life." ...
    (php.general)
  • Re: Good Morning
    ... > It is cold in this house when I wake up. ... fire requires certain things to get going. ... this way of getting warm takes a while. ... > I am grateful I have a house and a stove and wood to burn. ...
    (alt.gathering.rainbow)