Jump to content

[SOLVED] Wrong data type issue with an Array Session?


Solarpitch

Recommended Posts

Hey,

 

I have the array $_SESSION['viewed'][]; set up which will store visited products. When I check to see if an id is already in the array it tells me...

 

 

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/phone/public_html/view_product.php

 

Why cant they just allow it  ::)

 


<?php 

if(in_array($id, $_SESSION['viewed']))
{
//do noting...
}
else
{
$_SESSION['viewed'][] = $id ;
}

?>

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.