This topic is locked

How to reference an element in $_SESSION array

1/2/2010 9:38:38 AM
PHPRunner General questions
jpedwardspost author

Hi,
I need a bit of php help referencing a specific element in the multidimensional array $_SESSION.
I have used print_r($_SESSION);
and a little bit of the output I get is:
"Daily Report_asearchfor";a:1:{s:6:"result";s:5:"Sent:";}s:24:"Da
The value I am interested in the line above is "Sent:" - which is a term I am entering into the 'Advanced Search'
e.g. $value_I_need = $_SESSION("Daily Report_asearchfor") ; (This doesn't work).
How can I assign the _asearchfor element to a variable - the problem is I don't know how to reference it.
Thanks in advance for any suggestions,
JP.

A
alang 1/3/2010

Use square brackets: $_SESSION["Daily Report_asearchfor"]