I need to save an array in a field in the database table and I would like to know how best to do this if using serialize()
and unserialize()
or json_encode()
and json_decode()
.
I know you have other alternatives too, for example, you can use explode
and implode
or even better create another auxiliary table for that, but this option to create the auxiliary table has already been discarded and the other one I think would be the worst option.