I have this sitation:
..<img src="//http://www... OR ..<img src="/http://www... OR ..<img src="////http://www...
(/ - may be much)
How delete / before http? Resultat always should be:
..<img src="http://www...
Thanks ;)
I have this sitation:
..<img src="//http://www... OR ..<img src="/http://www... OR ..<img src="////http://www...
(/ - may be much)
How delete / before http? Resultat always should be:
..<img src="http://www...
Thanks ;)
A regular expression along the lines of this should do the trick I think:
$string = preg_replace('/="\/+http:/', '="http:', $string);
Assuming that the url is defined in a variable within your PHP, ltrim() could be the answer
$url = ltrim($url,'/');
though you wouldn't be able to use this option if you had local url's (eg '/images/img.gif') without the 'http://'