📄 opml.php
字号:
<?
header("Content-type: text/xml; charset=utf-8");
$dbh=mysql_connect("localhost:3306","root","");
mysql_select_db("ajax");
$query="select * from opml order by ID";
$res=mysql_query($query, $dbh);
$err=mysql_error();
if($err){
exit();
}
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
?>
<opml version="1.0">
<head>
<title>Blog 鍒楄〃</title>
<dateCreated></dateCreated>
<ownerName></ownerName>
</head>
<body>
<outline title="璁㈤槄鍒楄〃">
<?
while($row = mysql_fetch_array($res)) {
echo iconv("GB2312","UTF-8","<outline title=\"".XMLreplace($row["Title"])."\" htmlUrl=\"".$row["HtmlUrl"]."\" type=\"".$row["Type"]."\" xmlUrl=\"".$row["XmlUrl"]."\" lastDateTime=\"".$row["LastDateTime"]."\" ID=\"".$row["ID"]."\"/>\n");
}
?>
</outline>
</body>
</opml>
<?
function XMLreplace($str){
$str=str_replace("<","<",$str);
$str=str_replace(">",">",$str);
$str=str_replace("\"",""",$str);
return $str;
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -