I would like to know if allowing access to a membership area would be more efficient by htaccess allow or a PHP array of ips to check against every page. I am mainly interested in performance.

Are either of these methods recommended when your dealing with hundreds or even thousands of ips?

Is there a better way?

Update:

What if i sniffed for IP and then depending on if the IP is recognized I start a membership or none membership session so as to not have to check ip every pageview?