Skip to content
Advertisement

Tag: json

How can I get each value of array in PHP?

I get an endpoint which take some products of the database. That’s endpoint brings a JSON which looks like this: So, I need to make a table which shows colour[0] with size[0], colour[1] with size[1], etc. The main problem is that I can’t access by the name of the column (size and colour), because in another case, the name can

Extracting json string with PHP

JSON string that i received from the API Information that i wanted to extract My attempt The output: Did the JSON string that i received is in bad format? Why does it says undefined property? Appreciate any helps. thanks! Post that i’ve refer to: How do I extract data from JSON with PHP? Answer token is in the accessTokenResponse object,

Remove files which have not filename duplicates

For each document (.pdf, .txt, .docx ecc) I have also a corresponding json file with the same filename. Example: file1.json, file1.pdf, file2.json, file2.txt, filex.json, filex.pdf, But I got also some json files which are not accompanied with the corresponding document. I want to delete all json files which have no corresponding document. Im really stucked because I cant find a

Trying to get property name and id of laravel payload

I have this JSON payload below and want to get names and ids from the payload. However, l cannot object names and ids from the payload. Decode JSON Api json payloads Answer Use json_decode to decode the json to an associative array, then access the elements of the array as you would any other assoc array. It looks as though

how to create associative array from NOAA data

I’m trying to convert this to an associative array with json_decode but I’m messing up somewhere. $noaaRaw looks like: How do I convert that to an associative array? Answer file returns an array of lines. You want to use file_get_contents to get a string to decode: It is also possible after that, that you may need to enable allow_url_fopen.

Cant access Json Array values created by json_decode

My json_decode() is returning an array but i just cant seem to access it. Here’s as much of information i think would be useful. I’m pulling a json value from a server using curl commands. The response (output) from the server : Converting the json formatted string to json array: output: Clearly $res prints as Array for some reason, and

Conditional unset from Guzzle response

I’ve seen a few questions and the ones worth referencing How can i delete object from json file with PHP based on ID How do you remove an array element in a foreach loop? How to delete object from array inside foreach loop? Unset not working in multiple foreach statements (PHP) The last two from the list are closer to

How do i display the NESTED JSON data using php?

I coding a whole day just to display the nested Data from JSON that i got from the Api Provider but nothings gonna change. It’s always error! what should i do? Here’s my code hope you help me in this problem. Imagine my name of json file is 05-03-21.json. and here’s the JSON Data And here’s my php code. All

Advertisement