惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
F
Full Disclosure
小众软件
小众软件
V
V2EX
月光博客
月光博客
人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
M
MIT News - Artificial intelligence
Last Week in AI
Last Week in AI
The Register - Security
The Register - Security
T
Tailwind CSS Blog
Recorded Future
Recorded Future
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
阮一峰的网络日志
阮一峰的网络日志
B
Blog RSS Feed
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Fortinet All Blogs
C
Check Point Blog
云风的 BLOG
云风的 BLOG
T
The Blog of Author Tim Ferriss
雷峰网
雷峰网
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
V
Visual Studio Blog
J
Java Code Geeks
Y
Y Combinator Blog
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
美团技术团队
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
I
InfoQ
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
Martin Fowler
Martin Fowler
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)
D
Docker
The GitHub Blog
The GitHub Blog

Php on 张智勇 - 创业、投资

暂无文章

使用PHP调取MySql数据生成Sitemap网站地图
2022-04-22 · via Php on 张智勇 - 创业、投资

之前一直想自己做Sitemap网站地图但是不会,查了很多攻略都不能用,直到最近终于找到一个可用的(技术问题还是得靠Google啊),翻译并记录如下。

新建一个文件,例如命名为sitemap.php,按照自己的需求修改并输入以下代码,然后保存即可。直接打开https://www.yourdomian.com/sitemap.php即可使用,虽然不是xml格式,但是亲测Google、百度可以支持。

!AAA,改为你的数据库密码

!BBB,改为要使用的数据表。

!CCC,改为读取数据的数据列。

!DDD,改为排序方式,此处是倒序排列,如果需要正序就删除后面的desc。

!EEE,改为需要调用的数据条数。

!FFF,改为URL的前缀,例如前缀是https://www.zyzhang.com/,数据表里的数据是ABC,则Sitemap里面的链接就是「https://www.zyzhang.com/abc」