13c06-1.php
来自「介绍PHP5的给类型函数应用」· PHP 代码 · 共 15 行
PHP
15 行
<?php// Open a connection to NIST's time server, or dieif (!($tp = stream_socket_client('tcp://time.nist.gov:13', $err, $str))) { exit("ERROR: Failed to connect - {$err} - {$str}\n");}// Ignore the first line of output, it is blank:fgets($tp);// Now echo out the second line, it is the date string:echo trim(fgets($tp));// Close the connectionfclose($tp);?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?