How to properly use curl_init for a GET request in PHP? or Why is my curl_init GET request not workin

24 Replies, 2147 Views

If it’s failing silently, always check `curl_errno($ch)` and `curl_error($ch)`.

Also, some APIs need a user-agent. Try:
```php
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
```
Weird, but some block empty UAs.

Messages In This Thread



Users browsing this thread: 2 Guest(s)