How to read json properties using PHP -
How to get the properties of all the PIDs and styles from the following JSN data with minimum loop in PP < Pre ">" general ": {" note ": {" display ": false}}," elements ": {" -1 ": {" index ": 1," src ":" shirt1.png "," PID ":" PID-3563130 "," Angle ": 0," Styles ":" Background: Transparent, Top: 51.80000305175781px; Left: 122px; Width: 80px; Height: 80px; "," Background " : "Transparent", "Position": {"Top": 51.80000305175781, "Skip": 122}, "Size": {"Width": 80, {"Other": ""}}, "-2": {"Index": 2, "src": "shirt2.png", "PID": "PID": "PIT" 132,002 "," angle ": 0," styles ":" background: transparent, top: 44.80000305175781px; left: 155px; width: 80px; height: 80px; "," background ":" transparent "," position ": {"Other": ""}}}} {{"other": 44.80000305175781, "left": 155}, "size": {"width" ": 80," height ": 80} Code>
thanks
$ str = '{"normal": {"Note": {"display": false}}, "element": {"-1": {"index": 1, "src": "shirt1.png", "PID": "PID- 3,563,130 "," angle ": 0, "Styles": "Background: Transparent, Top: 51.80000305175781px; Left: 122px; Width: 80px; Height: 80px; "", "Background": "transparent", "position": {"top": 51.80000305175781, "left": 122}, "size": {"width": 80, "height": 80}, "description" {"Other": ""}}, "-2": {"index": 2, "src": "shirt2.png", "pid": "pid-13, 002", "angle": 0, "Styles": "Background: Transparent, Top: 44.80000305175781px; Left: 155px; Width: 80px; Height: 80px; "Description": {"width": 80, "height": 80}, "transparency", "position": {"top": 44.80000305175781, "left": 155}, "size": {"width" "$" ['Pid'] $ element = $ arr [elements]] as the $ element {echo 'pid:'. $ Element ['pid'] "$ arr = ]
"echo" style: '$ element [' style ']'
Comments
Post a Comment