php curl CURLOPT_CONNECTTIMEOUT code example
Example: php curl timeout
curl_setopt($ch, CURLOPT_TIMEOUT, 5); //timeout in seconds
#curl_setopt($ch, CURLOPT_TIMEOUT_MS, 5000); //timeout in Milliseconds
curl_setopt($ch, CURLOPT_TIMEOUT, 5); //timeout in seconds
#curl_setopt($ch, CURLOPT_TIMEOUT_MS, 5000); //timeout in Milliseconds