Serialize or json in PHP?

Posted by kavoir.com on Stack Overflow See other posts from Stack Overflow or by kavoir.com
Published on 2010-04-04T14:35:20Z Indexed on 2010/04/04 14:43 UTC
Read the original article Hit count: 320

Filed under:
|
|

So I need to encode an array in PHP and store it in plain text in MySQL database, my question is should I use serialize() or json_encode()? What are the advantages and disadvantages of each of them?

I think either of them would do in this situation. But which one would you prefer and why? If it is for something other than an array?

© Stack Overflow or respective owner

Related posts about php

Related posts about JSON