Jump to content

problem with array error


chanfuterboy

Recommended Posts

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

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'])?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.