📄 readtitle.php
字号:
<?php
//打开http://www.fanso.com的主页
$file = fopen ("http://www.tsinghua.edu.cn", "r");
//打开失败,输出错误信息
if (!$file) {
echo "<p>Unable to open remote file.\n";
exit;
}
//读取文件的内容
while (!feof ($file)) {
$line = fgets ($file, 1024); //每次读取1k
//如果读取的内容中包含<title>标签,就取出其中的内容即文件的标题
if (eregi ("<title>(.*)</title>", $line, $out)) {
$title = $out[1];
break;
}
}
fclose($file); //关闭文件
echo $title;
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -