PHP serialize() 函数
PHP 教程
· 2019-01-31 21:12:42
serialize() 函数用于序列化对象或数组,并返回一个字符串。
serialize() 函数序列化对象后,可以很方便的将它传递给其他需要它的地方,且其类型和结构不会改变。
如果想要将已序列化的字符串变回 PHP 的值,可使用 unserialize()。
PHP 版本要求: PHP 4, PHP 5, PHP 7
语法
string serialize ( mixed $value )
参数说明:
- $value: 要序列化的对象或数组。
返回值
返回一个字符串。
实例
实例
$sites = array('Google', 'Codercto', 'Facebook');
$serialized_data = serialize($sites);
echo $serialized_data . PHP_EOL;
输出结果为:
a:3:{i:0;s:6:"Google";i:1;s:6:"Codercto";i:2;s:8:"Facebook";}
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
Probability and Computing
Michael Mitzenmacher、Eli Upfal / Cambridge University Press / 2005-01-31 / USD 66.00
Assuming only an elementary background in discrete mathematics, this textbook is an excellent introduction to the probabilistic techniques and paradigms used in the development of probabilistic algori......一起来看看 《Probability and Computing》 这本书的介绍吧!