<?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 prevent SQL Injection using php |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
Write a PHP function to check if a given string is a palindrome |
Create a PHP script that counts the number of occurrences of each word in a given sentence. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
Create a PHP script that calculates the average of an array of numbers. |
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. |