I have the following code:
$date =
"<style>
background-image:url(\"/hamza.png\");
background-image:url(/hamza.png);
background-image:url('/hamza.png');
</style>";
I want to usepreg_match to check if the url start with a slash.
This is what I have tried:
if (preg_match('url\(("|\'|)(?:\/)\1\)', $data) {
echo 'yes';
} else {
echo 'no';
}
It always gives me "no". I would like to know what this code is for : (https?:\s*)?//.*?\1)