Voila, je vais essayer d'expliquer mon problème,
De base j'ai un fichier json
exemple:
je le transforme en array php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 { "debug": "on", "window": { "title": "Sample Konfabulator Widget", "name": "main_window", "width": 500, "height": 500 }, "image": { "src": "Images/Sun.png", "name": "sun1", "hOffset": 250, "vOffset": 250, "alignment": "center" } }
mais pour mon affichage j'aimerais obtenir un tableau ayant à peut près cette forme:
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 array (size=3) 'debug' => string 'on' (length=2) 'window' => array (size=4) 'title' => string 'Sample Konfabulator Widget' (length=26) 'name' => string 'main_window' (length=11) 'width' => int 500 'height' => int 500 'image' => array (size=5) 'src' => string 'Images/Sun.png' (length=14) 'name' => string 'sun1' (length=4) 'hOffset' => int 250 'vOffset' => int 250 'alignment' => string 'center' (length=6)
mais malgré toutes mes recherches je n'arrive pas à trouver de fonction permettant de remettre le chemin de clé pour chaque valeur du tableau =x
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 'debug' => string 'on' 'window'.'title' => string 'Sample Konfabulator Widget' 'window'.'name' => string 'main_window' 'window'.'width' => int 500 'window'.'height' => int 500 'image'.'src' => string 'Images/Sun.png' 'image'.'name' => string 'sun1' 'image'.'hOffset' => int 250 'image'.'vOffset' => int 250 'image'.'alignment' => string 'center'
Quelqu'un aurait-il une idée pour réussir la transformation ?
Partager