SyntaxFix
Write A Post
Hire A Developer
Questions
Use look behinds in preg_replace to remove anything before //.
preg_replace
//
preg_replace('(^[a-z]+:\/\/)', '', $url);
This will only replace if found in the beginning of the string, and will ignore if found later