I have a multidimensional array similar to this in PHP:
Array ( [folder1] => Array ( [folder11] => Array ( [0] => index.html [1] => tester.html ) [folder12] => Array ( [folder21] => Array ( [0] => astonmartindbs.jpg ) ) ) )
and should be converted to a string "file path" like this:
Array ( [0] => 'folder1/folder11/index.html' [1] => 'folder1/folder11/tester.html' [2] => 'folder1/folder12/folder21/astonmartindbs.jpg' )
Does anyone have any ideas?
I tried a lot of all deleted ... This is the starting point of my last attempt:
public function processArray( $_array ) { foreach( $_array AS $key => $value ) { if( is_int( $key ) ) { } else { if( is_array( $value ) ) { $this->processArray( $value ); } else { } } } echo $this->string; }
But I'm not ending ... I hope someone can help?
source share