0
<?php

    $oauth = array(OAuth oauth_consumer_key="9N7dVnXmOldmxrUDspHvWFbLs", oauth_nonce="688a87bf27008744490d42631e785d16", oauth_signature="vpXXl8lV0XvoG33J0t7Xc06RcrA%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1462202214", oauth_token="2936160236-wbvkaZjriGRQwxw6LhFdCnjEdNmE7xSOzmZt8t7", oauth_version="1.0");

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://api.twitter.com/1.1/trends/place.json?id=1");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($ch, CURLOPT_HTTPHEADER, $oauth);
    $response = curl_exec($ch);
    curl_close($ch);

    print_r($response);
    $data = json_decode($response,true);
    print_r($data);

    var_dump($data);

?>

the error is

Parse error: syntax error, unexpected 'oauth_consumer_key' (T_STRING), expecting ')' in C:\wamp\www\gg.php on line 3

halfer
  • 19,824
  • 17
  • 99
  • 186
Umang Suthar
  • 91
  • 1
  • 3
  • Take a moment to read through the [editing help](http://stackoverflow.com/editing-help) in the help center. Formatting on Stack Overflow is different than other sites. The better your post looks, the easier it is for others to read and understand it. – Rizier123 May 02 '16 at 15:55
  • Your array structure is wrong. Please RTM [http://php.net/manual/en/language.types.array.php](http://php.net/manual/en/language.types.array.php) – Rajdeep Paul May 02 '16 at 15:59
  • that's done finally i solved this problem – Umang Suthar May 08 '16 at 04:24

0 Answers0