0

I have a JavaScript array like this:

var f3_masks = [
    [
        {id: 0, id_name: '1-1', db_id: '3193586'},
        {id: 10, id_name: '3-4', db_id: '3193636'},
        {id: 20, id_name: '3-5', db_id: '3193636'}
    ],
    page2_fl = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],

    page2_fr = [
        './images/korpus1/floors/floor_3.jpg'
    ]
];

var f4_masks = [
    [
        {id: 0, id_name: '1-1', db_id: '3193586'},
        {id: 10, id_name: '3-4', db_id: '3193636'},
        {id: 20, id_name: '3-5', db_id: '3193636'}
    ]
];

etc. It's a pretty large set of arrays with thousands of strings. Part of it I can parse as JSON, but only part of it. What is the best way to read such JavaScript arrays without a regular stucture in PHP?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Taras Bulgakov
  • 543
  • 3
  • 11
  • 21

1 Answers1

-1

Keys must be in double quotes:

"page2_fl"

Try to use the checking service at http://jsonlint.com/.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
ka_lin
  • 9,329
  • 6
  • 35
  • 56