Re: Check contents of variable

From: Date: Tue, 20 Nov 2001 22:12:04 +0000
Subject: Re: Check contents of variable
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-75296@lists.php.net to get a copy of this message
How about: if (substr($url,0,7) <> "http://") $url = "http://" . $url; > Hi, > > which function would i use to check if a certain value is in the contents of > a variable? > > I have a form where the users submits url's. I need the url with > http:// in > the beginning. Since there is more data after the http:// i > can´t just do a > simple if-statement. So what do i do? > > After i determined if there is a http:// in the variable or not > i guess i > just have to $url = "http://" + $url; (?)... > > Regards > # Daniel Alsén | www.mindbash.com # > # d@mindbash.com | +46 704 86 14 92 # > # ICQ: 63006462 | # > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#75296) next »