Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use json_decode() function in php ?
So, Firstly let us know what is the use of json_decode() function ?
So json_decode() function is basically used for converting JSON string to array object.
you can see bellow example:
<?php
//here call your json data and stroe in a variable
$jsondata = '{"name":"joe","phone_number":1234567890,"address":"awang"}';
//here call json_decode() function for converint in a array object
$arrdata=json_decode($jsondata);
//here print $arrdata
print_r($arrdata);
?>
output will come following of above example
stdClass Object ( [name] => joe [phone_number] => 1234567890 [address] => awang )
0 Comment(s)