lopes_andre Posted March 31, 2010 Share Posted March 31, 2010 Hi, I have 5 IP's, I need to put them in an array and then compare with the user IP: IF ($ip is any of this 5 IP's) { //do things } How can I do this? Give me some clue. Link to comment https://forums.phpfreaks.com/topic/197169-how-to-do-this-control-sctructure/ Share on other sites More sharing options...
salathe Posted March 31, 2010 Share Posted March 31, 2010 You can use in_array $ip_array = array('1.2.3.4', '127.0.0.1'); if (in_array($ip, $ip_array)) { // do things } Link to comment https://forums.phpfreaks.com/topic/197169-how-to-do-this-control-sctructure/#findComment-1034952 Share on other sites More sharing options...
lopes_andre Posted March 31, 2010 Author Share Posted March 31, 2010 Great! It is working. Best Regards, Link to comment https://forums.phpfreaks.com/topic/197169-how-to-do-this-control-sctructure/#findComment-1034963 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.