30/03/2015

Serialize array safely

8

I have issue with putting serialized array containing “‘” into database. This is how to fix it:

//to safely serialize
$safe_string_to_store = base64_encode(serialize($multidimensional_array));

//to unserialize…
$array_restored_from_db = unserialize(base64_decode($encoded_serialized_string));

Source here.

About Author Mr.Bazz

Hi thanks for dropping by. Please share the content if you think there is someone who will appreciate it.

Leave A Comment

Your email address will not be published. Required fields are marked *