In my form I would like the visitor to be able to enter in a field any URL that is test.com or test2.com (wildcard), for example test.com/loquesea.
I have the following in PHP:
$allowedsites = array(
'http://test.com/*',
'http://test2.com/*',
);
if(in_array($longlink, $allowedsites)) {
$error = "The URL is in the array!";
}else{
$error = "The URL doesn't exists in the array.";
include ("crear.php");
exit;
}
I have tried without * and with *, it has not worked for me.
Thank you.