I have a url in a variable.
<?php
$a='www.example.com';
?>
I have another variable, that has like this
<?php
$b='example.com';
?>
In what way I can check that $b and $a are same. I mean even if the url in $b is like
'example.com/test','example.com/test.html','www.example.com/example.html'
I need to check that $b is equal to $a in this case. If it is like example.net/example.org as the domain name changes, it should return false.
I checked with strpos and strcmp. But I didn't find it is the correct way to check in case of urls.What function can I use to check that $b in this case is similar to $a?
$aand$b?parse_rul: php.net/manual/en/function.parse-url.php