substr should do what you need:
http://php.net/manual/en/function.substr.php
e.g.
if(substr( $string_n, 0, 19) === 'https://youtube.com')
{
// URL whitelisted
}
Obviously you would have to cater for http vs https etc...
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community