Ankündigung

Einklappen
Keine Ankündigung bisher.

Strings in array

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Strings in array

    Ich habe etwa 20k Strings.
    diese sind alle folgendermaßen aufgebaut: "topCat/subCat/subsubCat/endpoint"
    die Tiefe der "Cats" ist variabel
    ich hätte das jetzt gern in einem array, mit entsprechender Schachtelung.

    Gibt es da Ideen, wie man das elegant lösen kann?

  • #2
    einfach explode() pro Eintrag.
    [I]You know, my wife sometimes looks at me strangely. „Duncan“, she says, „there's more to life than Solaris“. Frankly, it's like she speaks another language. I mean, the words make sense individually, but put them together and it's complete nonsense.[/I]

    Kommentar


    • #3
      Das ist nicht das, was ich haben will...
      ich brauche danach EINEN array:

      root['toCat']['subCat']['subsubCat']...['endpoint']

      Kommentar


      • #4
        Dann gehst du die explode'den Daten pro Eintrag durch und erstellst auf dem Weg die Array-Keys und schreibst beim letzten den Wert rein.
        [I]You know, my wife sometimes looks at me strangely. „Duncan“, she says, „there's more to life than Solaris“. Frankly, it's like she speaks another language. I mean, the words make sense individually, but put them together and it's complete nonsense.[/I]

        Kommentar


        • #5
          Themenverwandt: https://www.php.de/forum/webentwickl...able-aus-array

          Kommentar


          • #6
            https://eval.in/991726
            [SIZE="1"]Atwood's Law: any application that can be written in JavaScript, will eventually be written in JavaScript.[/SIZE]

            Kommentar

            Lädt...
            X