shah rushabh shah rushabh - 2 months ago 6
JSON Question

How to save PHP array in database by converting array into JSON?

Here is a my PHP array. I want to convert it into JSON. after a converting to JSON. than after I want to save it in database how can I achieve this?

Array
(
[0] => 6:30pm
[1] =>
)
Array
(
[0] => 8:00pm
[1] =>
)

Answer

If you really need to store json in the database, you can use json_encode and json_decode.