chanfuterboy Posted March 12, 2010 Share Posted March 12, 2010 hi, can someone explain me maybe help me out with this problem, the error is Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/awortink/public_html/realgame/gallery_viewer.php on line 56 and in line 56 is (!in_array($_SERVER['REMOTE_ADDR'].$url2, $_SESSION['votes'])? Can someone helpme out on this Link to comment https://forums.phpfreaks.com/topic/195004-problem-with-array-error/ Share on other sites More sharing options...
GKWelding Posted March 12, 2010 Share Posted March 12, 2010 quite simply, $_SESSION['votes'] isn't an array. do a print_r on the $_SESSION['votes'] array key and see what you have there. If it's empty but should be an array then you may need a check around the in_array function like: (is_array($_SESSION['votes']) && !in_array($_SERVER['REMOTE_ADDR'].$url2, $_SESSION['votes'])? Link to comment https://forums.phpfreaks.com/topic/195004-problem-with-array-error/#findComment-1025170 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.