json - Simplify php curl code -
i trying json url. code working think better. (remove json_decode or json_encode). right have: (edit: still want use curl)
<?php $curl = curl_init('url'); curl_setopt($curl, curlopt_url, 'url'); curl_setopt($curl, curlopt_returntransfer, true); $result = curl_exec($curl); curl_close($curl); $data = json_decode($result, true); echo json_encode($data["name"]); ?>
you can try this:
$data = json_decode(file_get_contents('php://input')); print_r($data);
Comments
Post a Comment