darryncooke
Technical User
So I have this code but its not pulling anything.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$yelpstring = file_get_contents(" wont give this up that easily", true);
$obj = json_decode($yelpstring);
foreach($obj->businesses as $business):
echo $business->name."<br/>";
endforeach;
?>
</body>
</html>
I mean its pretty straight forward but nothing. Also how do i use json decode to decode an array within an array?
For example the array businesses has another array within it called reviews. how will i do to reviews what i have done to businesses?
Darryn Cooke
| The New Orange County Graphic designer and Marketing and Advertising Consultant
| Marketing and Advertising blog
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$yelpstring = file_get_contents(" wont give this up that easily", true);
$obj = json_decode($yelpstring);
foreach($obj->businesses as $business):
echo $business->name."<br/>";
endforeach;
?>
</body>
</html>
I mean its pretty straight forward but nothing. Also how do i use json decode to decode an array within an array?
For example the array businesses has another array within it called reviews. how will i do to reviews what i have done to businesses?
Darryn Cooke
| The New Orange County Graphic designer and Marketing and Advertising Consultant
| Marketing and Advertising blog