<?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 checks if a given string is a valid email address. |
Create a PHP script that prints the current date and time. |
Write a PHP script that calculates the factorial of a given number. |
Write a PHP script that calculates the sum of digits in a given number. |
Create a simple PHP script that calculates the sum of all even numbers between 1 and 10. |
Create a PHP function to count the number of vowels in a string. |
How to reverses a given string using PHP. |
Create a PHP script that checks whether a given number is a prime number or not. |