在用织梦开发网站的时候,文章的命名规则要以文章的title做为目录php
固然在调用地址的时候能够直接用[field:arcurl/]sql
可是我有的不是用的织梦的arclist标签 而是用的dede:php标签 里面须要本身写php须要调用到这个地址该怎么办呢数据库
不要急 只须要这样curl
{dede:php} $dsql->SetQuery("select id,title from dede_archives where typeid=1') order by a.pubdate desc limit 0,10"); $dsql->Execute();//执行SQL操做 while($row = $dsql->GetArray()){ $id=$row['id']; $title=$row['title']; $pingyin = Getpinyin($title,1); $url = '/game/'.$pingyin.'/'; } {/dede:php}
没错就是在php标签里直接调用该函数就能够将title转换为拼音函数
而在php页面就是本身写php的时候网站
个人意思是用织梦本身的sql调用方法ui
要引用这个文件url
require_once(dirname(__FILE__)."/../include/common.inc.php");code
没错引用了这个文件以后就连接了数据库,里面还有不少功能强大的函数能够供你使用开发
在里面你能够在任何地方使用Getpinyin()函数。
也能够本身去看下common.inc.php里面还有许多函数能够使用,并且运行速度要比你本身写的快不少。