Skip to content
Advertisement

Parsing JSON array in PHP that doesn’t have a key value

I am receiving an array in php after making a request but the array doesn’t have a key value. Not sure if I need to parse or convert to an object first. Im using the simple_html_dom PHP library.

Here is the PHP script that grabs the table data from a website –

JavaScript

The Array I get as a response is structured like so –

JavaScript

Ive tried parsing it like so but am not outputting any data –

JavaScript

I feel like the array within the array is whats causing me issues, do I need to convert the array in order to get “Model”?

Advertisement

Answer

Change out the

JavaScript

for

JavaScript

This will make a simple key value array.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement