SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to distinguish keys with same name?

    Hi,

    Previously I received great guidance from the wonderful forum community in the topic of split/trim/pattern matching but as I was working through it I ran into another delimma..ughhhh... help! Following is the data set that I'm trying to use the to store into an array but what happens when you have the same repeating name for the keys? how would the array distinguish that one is from data set 1 and data set 2? Assuming that you can't change the data sets. Thanks so much for all the help.

    //data set 1

    title1:
    texttext2

    header1:
    texttext2

    //key name is the same as dataset 2
    section: texttext1
    check: texttext1
    bullet: texttext1

    //data set 2

    title2:
    texttext2

    header2:
    texttext2

    //key name is the same as dataset 1
    section: texttext2
    check: texttext2
    bullet: texttext2

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Either create a new array for each data set, or add another depth level to the multidimensional array.

  3. #3
    SitePoint Zealot sajjad's Avatar
    Join Date
    May 2005
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to add 2 dimentional array for this
    If you lose your patience you lose half of battle


Bookmarks

Posting Permissions

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