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
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
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
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
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.
--
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
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
7 matches
Mail list logo