Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Dec 2005
    Posts
    217
    Thanks
    1
    Thanked 0 Times in 0 Posts

    coverting "." serparated string to an array ??

    Hello forums!!
    Suppose we had list of strings in an array in a hierarchical form(separated by ".") as follows:
    Code:
    FOLDER1
    FOLDER1.subfolder1
    FOLDER1.subfolder2
    FOLDER1.subfolder2.sub_subfolder1
    FOLDER1.subfolder2.sub_subfolder12
    .. can go upto n levels
    FOLDER2
    FOLDER2.subfolder1
    I want to convert such string in an array , For example
    PHP Code:
    array("FOLDER1" => array("subfolder1""subfolder2" => array("sub_subfolder1","sub_subfolder12"), ...), "FOLDER2" => array("subfolder1"), ...etc
    How to accomplish this as it seems to be recursive.
    Thanks in advance for the valueable tips and suggestions.

  • #2
    New Coder
    Join Date
    Nov 2007
    Location
    Thane-Vashi,Mumbai,India.
    Posts
    44
    Thanks
    3
    Thanked 2 Times in 2 Posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •