[PHP] Converting print_r() output to an array

2009-09-30 Thread James Colannino
Hey everyone, I was pretty sure there was an easy built-in solution for what I want to do, but I've been googling around with no luck. Basically, I just want to take a string containing the output of print_r() and convert it back into an array again. That is possible, right? If so, how do I go

Re: [PHP] Converting print_r() output to an array

2009-09-30 Thread Michael Shadle
first off, if you pass print_r($var, true) it will return it instead of printing it. if you go that route. have you looked at var_export() ? On Wed, Sep 30, 2009 at 8:07 PM, James Colannino ja...@colannino.org wrote: Hey everyone, I was pretty sure there was an easy built-in solution for what

Re: [PHP] Converting print_r() output to an array

2009-09-30 Thread Jonathan Tapicer
Hi, May be you want to take a look at serialize and unserialize functions, serialize generates a string from a variable and then unserialize can give you the value of the variable back from the string. Regards, Jonathan On Thu, Oct 1, 2009 at 12:07 AM, James Colannino ja...@colannino.org

Re: [PHP] Converting print_r() output to an array

2009-09-30 Thread Daniel Brown
On Wed, Sep 30, 2009 at 23:07, James Colannino ja...@colannino.org wrote: Hey everyone, I was pretty sure there was an easy built-in solution for what I want to do, but I've been googling around with no luck. Basically, I just want to take a string containing the output of print_r() and