I would highly recommend that you DON'T use regular expressions unless it is absolutely essential.
Use str_replace instead, it is MUCH faster.
= = = = = = = = = = =
To check the existence of a substring in a string, use the following:
if (strstr('http://www.phpbuilder.com','http://')) {
echo "Substring found."
} else {
echo "Substring not found."
}
You could also use stristr() for case-insensitive searches.
= = = = = = = = = = =
Here is my suggestion.
<?
$string='http://'.str_replace('http://','',$string);
?>
Hope this helps,
cdbsi. 😃