Answers for "php serialize array"

PHP
0

php serialize array

$array["a"] = "Foo";
$array["b"] = "Bar";
$array["c"] = "Baz";
$array["d"] = "Wom";

$str = serialize($array);
Posted by: Guest on March-14-2020
1

php serialize()

php array to be storable value in $_SESSION:
 serialize($array)
  serialized array element to be output on page:
unserialize($serializedArray)
Posted by: Guest on May-17-2020
0

php array serialize

//If you plan to serialize and store it in file or database use below syntax
//to safely serialize
$safe_string_to_store = base64_encode(serialize($multidimensional_array));

//to unserialize...
$array_restored_from_db = unserialize(base64_decode($encoded_serialized_string));
Posted by: Guest on November-30-2020

Browse Popular Code Answers by Language