Re: [PHP] Checking for http://

2008-08-29 Thread Gergely Hodicska
You could use substr() (www.php.net/substr) strncmp is better and faster for this purpose. Best Regards, Felhő -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Checking for http://

2008-08-29 Thread Eric Butera
On Fri, Aug 29, 2008 at 11:33 AM, Dan Joseph <[EMAIL PROTECTED]> wrote: > You could use substr() (www.php.net/substr) > > if ( substr( $web_site, 0, 7 ) != "http://"; ) > { > $web_site = "http://"; . $web_site; > } > > -- > -Dan Joseph Or parse_url() -- PHP General Mailing List (http://www.php.n

Re: [PHP] Checking for http://

2008-08-29 Thread Dan Joseph
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 subs

[PHP] Checking for http://

2008-08-29 Thread Ron Piggott
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

Re: [PHP] Checking for HTTP:// at the start of a string and more ////

2003-03-01 Thread Ernest E Vogelsinger
At 05:09 01.03.2003, Philip J. Newman said: [snip] >I would like to check for HTTP:// at the start of a string and for at least >1 . and a / at the end of a string. > >I have tried ereg, but the documentation is not too clear how to format. --

Re: [PHP] Checking for HTTP:// at the start of a string and more////

2003-02-28 Thread Rasmus Lerdorf
You don't need a regular expression. Look at the substr() function. -Rasmus On Sat, 1 Mar 2003, Philip J. Newman wrote: > I would like to check for HTTP:// at the start of a string and for at least > 1 . and a / at the end of a string. > > I have tried ereg, but the documentation is not too cle

[PHP] Checking for HTTP:// at the start of a string and more ////

2003-02-28 Thread Philip J. Newman
I would like to check for HTTP:// at the start of a string and for at least 1 . and a / at the end of a string. I have tried ereg, but the documentation is not too clear how to format. -- Philip J. Newman. Head Developer [EMAIL PROTECTED] +64 (9) 576 9491 +64 021-048-3999 -- Friends