<?php
$json_data = '{"name": "John", "age": 30, "city": "New York"}';
$data = json_decode($json_data, true);
echo "Name: " . $data['name'] . ", Age: " . $data['age'] . ", City: " . $data['city'];
?>
<?php
$json_data = '{"name": "John", "age": 30, "city": "New York"}';
$data = json_decode($json_data, true);
echo "Name: " . $data['name'] . ", Age: " . $data['age'] . ", City: " . $data['city'];
?>
Related
How to check whether a given year is a leap year using php. |
How to get the largest element in an array of numbers |
Create a PHP script that counts the number of occurrences of each word in a given sentence. |
Create a PHP script that prints the current date and time. |
Write a PHP function that throws a custom exception if a condition is not met. |
Write a PHP script that connects to a MySQL database and fetches data from a table. |
How to check if a given number is a perfect number. |
Create a PHP script that checks whether a given number is a prime number or not. |
