How to resolve syntax error, unexpected [ in guzzle?

1.3k Views Asked by At

I am trying to using guzzle to pass the referer as mentioned by one of the stackoverflow user on one of my question asked here: related stackoverflow question unresolved

require_once("../plugins/Guzzle/vendor/autoload.php");

    //use GuzzleHttp\Client;
    $headers = ['Referer' => 'https://mywebsite.com'];  
    $httpClient = new Client([
'headers' => $headers
]);

but above through the error: syntax error, unexpected '[' and nothing works.:(

So can anyone please help me to find my mistake or what I am doing wrong here.

This question is a bit different as after improving guzzle to resolve the previous "referer" error. I end up with this new guzzle error.

So both questions have it's own issue.

Thanks

0

There are 0 best solutions below