Combine arrays based on array values PHP
$15-16 USD
$15-16 USD
Paid on delivery
Here sample arrays:
$array = ();
$array[] = array(
'filename' => 'File 1'
'folders' => array('Folder 1', 'Folder 2', 'Folder 3')
);
$array[] = array(
'filename' => 'File 2'
'folders' => array('Folder 1', 'Folder 2')
);
$array[] = array(
'filename' => 'File 3'
'folders' => array('Folder 1', 'Folder 2', 'Folder 3')
);
$array[] = array(
'filename' => 'File 4'
'folders' => array()
);
$array[] = array(
'filename' => 'File 5'
'folders' => array('Folder 1')
);
$array[] = array(
'filename' => 'File 6'
'folders' => array('Folder 1')
);
When we combine arrays, it should display array according to "folders". (Notice that, last array file is not in the folder ) So, desired output should be array version of this:
Root
- File 4
- Folder 1
-- File 5
-- File 6
-- Folder 2
--- File 2
--- Folder 3
---- File 1
---- File 3
.. etc..
Thank you.
Project ID: 34404637
About the project
14 proposals
Remote project
Active 2 yrs ago
Looking to make some money?
Benefits of bidding on Freelancer
Set your budget and timeframe
It's free to sign up and bid on jobs