inarray function won't work with session variable that is set to array
Everytime the script that contains the inarray function executes, the element disappears and the开发者_如何学Go ones that comes after it. I believe it means that it's not working. I set the session variable to an array just like setting a regular variable to an array.
$items = array("A", "B", "C");
$_SESSION["item"] = $items;
if(inarray("A", $_SESSION["item"])) { echo "An item!"; }
This doesn't work. I can't get the echo to work. On top of that, the elements that comes after it disappears indicating that it doesn't work?
if you mean standard in_array function then there is the mistake in your code
精彩评论