Multidimensional Array (with some values not sub-arrays) to string?
<p>I am trying to turn a multidimensional array into a patterned string with this <code>array_map</code> function:</p>

<pre><code>function array_to_string($array) {
    return implode("&amp;",array_map(function($a){return implode("~",$a);},$array));
}
$arr = array("hello",array("blue","red"),array("one","three","twenty"),"random");
array_to_string($arr);
</code></pre>

<p>Between each array element "&amp;" and between each sub-array element (if it is an array) "~"</p>

<p>Should Output: <code>hello&amp;blue~red&amp;one~three~twenty&amp;random</code></p>

<p>However this outputs: <code>Warning: implode(): Invalid arguments passed</code> (2)
I tried changing the function within the <code>array_map</code> to detect whether the multi-array's value <code>is_array</code> but from my outputs, I don't think that is possible? So essentially, I guess the real question is how can I place a test on the <code>array_map</code> function to see whether or not it <code>is_array</code></p>
