最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 正则表达式 取标题,关键词,内容代码
时间:2009-05-07 编辑:简简单单 来源:一聚教程网
//获取标题
$inarr = array();
preg_match("/
if(isset($inarr[1]))
{
$redatas['title'] = $inarr[1];
}
//获取关键词
$inarr = array();
preg_match("/
if(isset($inarr[1]))
{
$redatas['keywords'] = cn_substr(html2text($inarr[1]),30);
}
//获取摘要
$inarr = array();
preg_match("/
if(isset($inarr[1]))
{
$redatas['description'] = cn_substr(html2text($inarr[1]),$cfg_auot_description);
}
//获取内容
if($s!='' && $e!='')
{
$redatas['body'] = GetHtmlAreaA($s,$e,$body);
if($redatas['body']!='' && $redatas['description']=='')
{
$redatas['description'] = cn_substr(html2text($redatas['body']),$GLOBALS['cfg_auot_description']);
}
}
}
return $redatas;
-
下一个: php in_array 函数
相关文章
- PHP最常用的正则表达式 04-05
- php开发中常用的正则表达式大全 04-16
- php 正则表达式(.*)和(.*?)区别 03-12
- php 正则表达式 ?= ?!是什么意思 01-31
- 正则表达式 VerbalExpressionsPhp使用例子 05-21
- PHP 正则表达式使用说明 07-10