开发者

Uses of serialize() in php [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. 开发者_如何转开发For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

Uses of serialize() in php.its advantages and dis advantages


Advantages:

Turns objects into a string

Disadvantages:

Turns objects into a string


Disadvantages

  • Resources are not serialized, and have to be manually recreated when unserialized
  • Implementation has a number of open bugs

Advantages

PHP provides magic methods allowing you to handle this disadvantage


I dont see any disadvantage of serialization.

Advantage is that you can serialize objects and arrays and save them (for example in database). Later, you can get objects back (unserialize) in the exactly same state, in which they were saved.


http://us2.php.net/manual/en/function.serialize.php


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


Only disadvantage is with utf8 encoding!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜