1--TEST-- 2Test curl_getinfo() function with CURLINFO_HTTP_CODE parameter 3--CREDITS-- 4Jean-Marc Fontaine <jmf@durcommefaire.net> 5--SKIPIF-- 6<?php 7if (!extension_loaded("curl")) exit("skip curl extension not loaded"); 8if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined"); 9?> 10--FILE-- 11<?php 12 $host = getenv('PHP_CURL_HTTP_REMOTE_SERVER'); 13 14 $url = "{$host}/get.php?test="; 15 $ch = curl_init(); 16 curl_setopt($ch, CURLOPT_URL, $url); 17 curl_exec($ch); 18 var_dump(curl_getinfo($ch, CURLINFO_HTTP_CODE)); 19 curl_close($ch); 20?> 21===DONE=== 22--EXPECTF-- 23Hello World! 24Hello World!int(200) 25===DONE=== 26