- preg_match: documentation ( source)
<?php
$str = 'http://www.espace-aubade.fr/?gclid=CNTmyNagl74CFQEXwwodfVwAYQ';
echo preg_match("#^(http://)?(www\.)?espace-aubade\.com/?.*$#", $str);
$str = 'http://www.espace-aubade.com/?gclid=CNTmyNagl74CFQEXwwodfVwAYQ';
echo preg_match("#^(http://)?(www\.)?espace-aubade\.com/?.*$#", $str);
$str = 'http://espace-aubade.fr/?gclid=CNTmyNagl74CFQEXwwodfVwAYQ';
echo preg_match("#^(http://)?(www\.)?espace-aubade\.com/?.*$#", $str);
$str = 'espace-aubade.com';
echo preg_match("#^(http://)?(www\.)?espace-aubade\.com/?.*$#", $str);