php3-list | 2000051
Date: 05/12/00
- Next message: Craig Vincent: "RE: [PHP3] "order by" Question"
- Previous message: John Huggins: "RE: [PHP3] PHP, MySQL Hosting and Security"
- In reply to: Thomas Deliduka: "Re: [PHP3] Big Challenge"
- Next in thread: Boaz Yahav: "RE: [PHP3] Big Challenge"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thomas Deliduka pressed the little lettered thingies in this order...
> On 5/6/00 10:34 AM SANIsoft said:
>
> > This had come up on the list - may help
>
> Thanks. I wonder, do you think it's possible to modify it to link not
> only those starting with http:// but also just www.?
>
> What I'm looking at here is completely greek to me.
I missed the original post, so forigive me if I miss the point here...
To use regexps to figure out if a supplied address begins with the
proper formatting, you could use the following:
if (!eregi("^http",$URL)) {
$URL="http://".$URL; }
This tells PHP that if $URL does not start with "http" to insert
"http://" If you are trying to auto-generate <A HREF... tags and
don't have confidence that the person/people supplying the
address(es) are going to be typing the "http://" this ereg check is
a fast and simple solution.
Good luck...
Christopher Ostmo
a.k.a. support <email protected>
Rosenet, Inc.
For a good time,
http://modems.rosenet.net/mysql/
-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Craig Vincent: "RE: [PHP3] "order by" Question"
- Previous message: John Huggins: "RE: [PHP3] PHP, MySQL Hosting and Security"
- In reply to: Thomas Deliduka: "Re: [PHP3] Big Challenge"
- Next in thread: Boaz Yahav: "RE: [PHP3] Big Challenge"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

