I am a webmaster who is fairly new to PHP but what I want to do is fairly simple I think.
I want to execute some javascript if a check returns true. What I want to do is have PHP check the IP of whomever is browsing a page on my site, compare it to, say, an array of IPs and if it matches any of them execute the code. There are really a lot of uses for this, like having my web page pop up an alert window to my moms IP or for denying access to the page to people who are banned from my forums.
I can manually add IPs to the array and I can get the visitors IP but the part I'm unsure of is how to compare the visitors IP with every IP in the array and immediately exit and return true when a match is found.
Any help would be very appeciated.