1$array["a"] = "Foo";
2$array["b"] = "Bar";
3$array["c"] = "Baz";
4$array["d"] = "Wom";
5
6$str = serialize($array);
1php array to be storable value in $_SESSION:
2 serialize($array)
3 serialized array element to be output on page:
4unserialize($serializedArray)
1//If you plan to serialize and store it in file or database use below syntax
2//to safely serialize
3$safe_string_to_store = base64_encode(serialize($multidimensional_array));
4
5//to unserialize...
6$array_restored_from_db = unserialize(base64_decode($encoded_serialized_string));