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 …
Tag: json
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…
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 …
Passing options containing blank spaces from Laravel blade to Vue multiselect
I’m trying to use Vue Multiselect in my Laravel blade file. I am putting the data in array and pass it in options as props. When option is one word(ex. “View”) everything is working. But when the option contains multiple words(ex. “View customer”) I am receiving the following err…
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 …
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, …
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 $…
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 lis…
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…
Ajax request json PHP – jsondata mixed with other prints (echoes)
I have an ajax-script that retrieves jsondata from php – so far ok, but the data could not be parsed since other outputs (echoes) comes along with the jsonstring. I searched this issue and it seems …