Link Details

Link 200035 thumbnail
User 361058 avatar

By takkie
via techblog.procurios.nl
Published: Jul 06 2009 / 09:01

While developing software like our framework you will need to cache a large data array to a file at some point sooner or later. At such a point you need to choose what caching method you will be using. In this article I will compare three methods: JSON, serialization and var_export() combined with include().
  • 19
  • 0
  • 719
  • 249

Comments

Add your comment
User 258461 avatar

EllisGL replied ago:

0 votes Vote down Vote up Reply

There is one point that is somewhat wrong in the article. Talking about serialization: "Can not be used outside of a PHP application". Look at http://phpjs.org/functions/serialize:508 and http://phpjs.org/functions/unserialize:571
If you can do it in Javascript, then I'm sure you can do it anywhere.

User 361058 avatar

takkie replied ago:

0 votes Vote down Vote up Reply

I meant to say that a PHP-serialized string can not be unserialized outside of PHP _natively_. Sure you can create custom functions to serialize and unserialize like PHP does.

User 258461 avatar

EllisGL replied ago:

0 votes Vote down Vote up Reply

Ah ok! =)

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.