数组转化成字符串,并原样还原回数组
时间:2021-07-01 10:21:17
帮助过:11人阅读
<无详细内容>
- $str = array
- (
- 'a' => 'aa',
- 'b' => 'bb',
- 'c' => array
- (
- 0 => 1,
- 1 => 2,
- 2 => 34,
- 3 => 4,
- ),
- );
- //把数组转化成字符串,可以进行直接存储到数据库中
- $s = var_export($str, true);
- //从字符串中还原回数组
- eval("\$st = $s;");
- var_dump($st);
|