Chris92 Posted April 6, 2010 Share Posted April 6, 2010 I'm trying to explode a string into a logical array that will be built into a multi dimensional navigation. basically the array would need to look like this: Array ( [Home] => home.php [services] => Array ( [0] => services.php [Foo] => Array ( [0] => foo.php [bar] => chocolate.php ) ) [Contact] => contact.php ) And it will turn into a ul list: <ul> <li> <a href="home.php">Home</a> </li> <li> <a href="services.php">Services</a> <ul> <li> <a href="foo.php">Foo</a> <ul> <li> <a href="chocolate.php">Bar</a> </li> </ul> </li> </ul> </li> <li> <a href="contact.php">Contact</a> </li> </ul> I would just like to know if it would be possible to make an array like this from a string. Link to comment https://forums.phpfreaks.com/topic/197802-multi-dimensional-array-from-string/ Share on other sites More sharing options...
teamatomic Posted April 6, 2010 Share Posted April 6, 2010 Yes, but it depends on what the string contains. HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/197802-multi-dimensional-array-from-string/#findComment-1038061 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.