- $str = array
- (
- 'a' => 'aa',
- 'b' => 'bb',
- 'c' => array
- (
- 0 => 1,
- 1 => 2,
- 2 => 34,
- 3 => 4,
- ),
-
- );
- //Convert the array into a string, which can be directly stored in the database
- $s = var_export($str, true);
- //Restore back to array from string
- eval("$st = $s;");
- var_dump($st);
Copy code
|