Using serialize () in php

Using serialize () function in the benefits and advantages of php.its

+4
source share
6 answers

Benefits:

Turns objects into a string

Disadvantages:

Turns objects into a string

+12
source

disadvantages

<strong> Benefits

PHP provides magic methods to help you deal with this flaw.

+6
source

I see no shortage of serialization.

The advantage is that you can serialize objects and arrays and save them (for example, in a database). Later you can return objects (unserialize) to the exact same state in which they were saved.

+1
source

It turns the object or array passed to it as the first (and only) argument into a string. For example, this function is useful for storing objects in a database or file. To rotate a string back into an object or array, use unserialize (). Also see function documentation: http://us2.php.net/manual/en/function.serialize.php

+1
source

The only drawback is utf8 encoding!

-1
source

Source: https://habr.com/ru/post/1335808/


All Articles