How do I get the values in the session in PHP?
After the login verification is complete, I save the message to the session and then jump to another interface, and find out in the other interface that no matter how you try, you can only get a value.
In the verification page I also output can get the value of the page after the jump how can not be
share to: more
------Solution--------------------
String is a simplexmlelement Object and is not a standard normal array item.
$newposition = (array) $position;
------Solution--------------------
You have to deal with the source of the garbled.
You only changed the code of the page, of course it is not!
Your page is GBK, and simplexmlelement Returns the result is Utf-8, garbled is normal
$_session[' position '] = Strval ($position); This is utf-8.
$_session[' position ' = iconv (' utf-8 ', ' GBK ', Strval ($position)); This is the GBK.
The principle of writing and debugging a program is to reduce the problem to a small extent as much as possible (so that it is easy to solve the problem) rather than let the problem spread.