note 75450 deleted from function.strpos by nlopess
| From: | nlopess@php.net | Date: | Tue, 19 Jun 2007 12:16:37 +0000 |
| Subject: | note 75450 deleted from function.strpos by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127741@lists.php.net to get a copy of this message | ||
Note Submitter: Basti by basti.funhome.de
----
This checks the String $user_site and when the String is not empty and there is no http:// this will it add in the beginning of the String.
<?php
$http = 'http://';
$pos = strpos($user_site, $http);
if ($pos === false && !empty($user_site)) {
$user_site = $http.$user_site;
}
?>
by http://basti.funhome.de