Serialize array safely

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.

Shopping di DDShop.Online:
- gadget murah
- barang rare
- F&B halal Muslim
Lawat DDShop.Online dan alami pengalaman BARU!

Leave a Comment