Question: I have an array:

```
$a = array('foo' => 'fooMe');

```

and I do:

```
print_r($a);

```

which prints:

```
Array ( [foo] => printme )

```

Is there a function, so when doing:

```
needed_function('    Array ( [foo] => printme )');

```

I will get the array `array('foo' => 'fooMe');` back?

Answer: 
If you want to store an array as string, use [`serialize` *[docs]*](http://php.net/manual/en/function.serialize.php) and [`unserialize` *[docs]*](http://php.net/manual/en/function.unserialize.php).

To answer your question: No, there is no built-in function to parse the output of `print_r` into an array again.
No. But you can use both `serialize` and `json_*` functions.

```
$a = array('foo' => 'fooMe');
echo serialize($a);

$a = unserialize($input);

```

Or:

```
echo json_encode($a);

$a = json_decode($input, true);

```