How to check if a string starts with a specified string?
PHP 8 or newer: Use the str_starts_with function: PHP 7 or older: Use the substr function to return a part of a string. If you’re trying to make sure it’s not another protocol. I’d use http:// instead, since https would also match, and other things such as http-protocol.com. And in general: