Working with API with PHP & jQuery


/*jQuery Code*/
$.ajax({
type: ‘POST’,
url: re_url,
data:{“property”: “value”},
}).success(function(result){
$(“.data_div”).html(result);
});

/*PHP code*/
$url = “API URL”;
$doump_values = file_get_contents($url);
$json = json_decode($new_results);

echo “Value: “.$json->property;

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s