inarray函数不适用于设置为array的会话变量

Everytime the script that contains the inarray function executes, the element disappears and the 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