Vilmar Pavesi
Vilmar Pavesi

Reputation: 61

PHP curl_exec return

I am using this CURLOPT_RETURNTRANSFER => 1 in my code that's return a result if success.

My question is:

The curl_exec() will return a result if I get a response with status != 200 ? like 400 and a message ? or in this case just FALSE ?

Upvotes: 0

Views: 114

Answers (1)

BambinoUA
BambinoUA

Reputation: 7100

Please read the manual carefuly. The answer is there. https://www.php.net/manual/en/function.curl-exec.php

Note that response status codes which indicate errors (such as 404 Not found) are not regarded as failure. curl_getinfo() can be used to check for these.

Upvotes: 1

Related Questions