PHP Array to String equivalent

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2010-04-09T07:36:44Z Indexed on 2010/04/09 7:43 UTC
Read the original article Hit count: 421

Filed under:
|
|

Hey all,

I'm wondering if anyone has a recursive solution to converting an array to a string.

Here's what I mean:

An array $args that has the following contents:

Array
(
    [0] => $hello
    [1] => 411px
    [Jeeves] => Array
        (
            [compiling] => 1
        )

)

Result after calling arr_to_string($args):

array($hello,"411px", "Jeeves" => array("compiling" => 1));

Note: It recognizes the $ sign in front and therefore does not add quotes. It does the same for numbers.

Anyone have any solution or can point me in the right direction?

Thanks! Matt Mueller

© Stack Overflow or respective owner

Related posts about php

Related posts about recursion