i need to see if http:// exist in the first 7 chars in the var $link
how would i code this? with a if statement or something
Also i need it to add it to the beginning if it doesn't have http://
and one more thing i need it to search for a word and if it exist then it will give a error.
if anyone can help then thank you.
Help with variables/strings
Moderator: General Moderators
Re: Help with variables/strings
You can use strpos() to determine if the first 7 characters are "http://" (Ref: http://php.net/manual/en/function.strpos.php) and you can use the dot concatenation operator to modify the string if it doesn't.