Skip to content
Advertisement

Tag: json

Comparing a JSON file and a PHP file

First Post, any help is appreciated. I have a PHP file (Array) with data from a database, which i need to compare to a JSON file (Object). By looking through forums i have seen stuff about jQuery and AJAX requests, so i was thinking maybe i need to use those for my solution. The PHP Array and the array goes

How to add json with fixtures

On symfony I am trying to add some fixtures to the database some of which requires json format. I tried : I tried different other variations but in vain what is the correct way to do it? Answer You need to use the function json_encode to convert it into json. Output: {“France”:29}

how to search inside two JSON files at a time in PHP

I have two JSON files of same format, forexample 1st JSON File 2nd JSON file Each user has a unique “id”, I want to get their id by searching their name in php, how can I do this This is my PHP script Each user has a unique “id”, I want to get their id by searching their name in

How i can make php sort by value name [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question i want to make which one is “live” at “status” case inside json begin from first. “finish” second “soon” 3th.

Convert a json to multi-dimensional PHP array

I have the following json sent to my API endpoint {“key”:”levels”,”value”:”[{role_id:1, access_level_id:3}, {role_id:2, access_level_id:1}, {role_id:3, access_level_id:2}]”,”description”:””} at the backend, I receive it as a Laravel request as follows: And it returns the following expected result array ( ‘key’ => ‘levels’, ‘value’ => ‘[{role_id:1, access_level_id:3}, {role_id:2, access_level_id:1}, {role_id:3, access_level_id:2}]’, ‘description’ => NULL, ) But I need to convert the ‘value’ to

Add JSON keys/values while creating another JSON PHP

I am trying to pass some JSON keys/values that I have to another JSON I am creating dynamically. For example, this is the JSON I have in $json_create That comes over file_get_contents And this is the JSON I am creating Which print something like What I am trying to achieve is There is quite a lot on that subject but

Advertisement