Forum Moderators: coopster
Right now I use this:
if(in_array($domain,$program)) $track=true;
With $program being an array looking like this:
$program=array("law.cornell.edu","gpoaccess.gov");
Right now $track is set true if $domain matches "law.cornell.edu" or "gpoaccess.gov", but I would like to set program to something like:
$program=array(".edu",".gov","google.co.uk","amazon.com");
That way, all .edu sites, all .gov sites, and only specified other sites make $track=true;
How can I do this? in_array seems close, but isn't quite right.
Thanks
Your other option will be to loop through the $program array and use a regular expression to check each value as you iterate the array.