switch(connection_status())
{
case CONNECTION_NORMAL:
$txt = 'Connection is in a normal state';//連接配接運作正常
break;
case CONNECTION_ABORTED:
$txt = 'Connection aborted';//連接配接由使用者或網絡錯誤終止
break;
case CONNECTION_TIMEOUT:
$txt = 'Connection timed out';// 連接配接逾時
break;
case (CONNECTION_ABORTED & CONNECTION_TIMEOUT):
$txt = 'Connection aborted and timed out';
break;
default:
$txt = 'Unknown';//未知錯誤
break;
}
echo $txt;
define("GREETING","Hello world!");//定義常量
echo constant("GREETING");//輸出常量
define("GREETING","Hello world!",true);//定義常量,不區分大小寫
echo constant("greeting");//輸出常量
define("GREETING","Hello world!");
echo defined("GREETING");//判斷常量是否存在
$site = "666";
fopen($site,"r")
or die("Unable to connect to $site");//輸出資訊,并推出目前程式
echo "66666448";
?>
$string = "beautiful";
$time = "winter";
$str = 'This is a $string $time morning!';
echo $str. "
";
eval("\$str=\"$str\";");//必須以分号;結束,不然會報錯
echo $str;
$site="6666";
fopen($site,"r")
or exit("Unable to connect to $site");
echo $_SERVER['HTTP_USER_AGENT'];
$browser=get_browser(null,true);//傳回浏覽器的性能
print_r($browser);
echo date('h:i:s');
sleep(10);
echo "
";//耐心等十秒
echo date('h:i:s');
echo uniqid();//重新整理都會變.以微秒計的目前時間,生成一個唯一的 ID。
echo date('h:i:s') . "
";
//延遲 10 描述
usleep(10000000);//一微秒等于百萬分之一秒。
//再次開始
echo date('h:i:s');
?>