Skip to content

Commit 0a0bbcb

Browse files
authored
api.php
直接输出API,方便各端访问数据。
1 parent 48a5097 commit 0a0bbcb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: api.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
//设置json格式头部
3+
header('Content-type: application/json');
4+
//载入数据库文件
5+
require("data.php");
6+
$sql="select * from soul order by rand( ) limit 1";
7+
$row=mysql_fetch_assoc(mysql_query($sql));
8+
//输出json
9+
echo json_encode(array('code'=>1,'data'=>$row['title']));
10+
?>

0 commit comments

Comments
 (0)