<?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
Write a PHP script that calculates the sum of digits in a given number. |
Write a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits. |
Create a PHP function to count the number of vowels in a string. |
How to check whether a given year is a leap year using php. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
Create a PHP script that checks whether a given number is a prime number or not. |
Create a PHP script that processes a form submission and displays the submitted data. |
Write a PHP script that calculates the factorial of a given number. |