query($sql)->fetchall();foreach($rows as $row){$str = $row[detail]; preg_match("/[".chr(0"/>
PHP头条
热点:

PHP运用正则表达式获取字符串中的特定字符-PHP源码


1. [PHP]代码

query("set names gb2312");
$sql="SELECT * FROM `sales"`;
$rows = $db->query($sql)->fetchall();
foreach($rows as $row)
{
$str  =  $row['detail'];  
preg_match("/[".chr(0xa1)."-".chr(0xff)."]{4}市/",$str,$regs);  
echo $regs[0]?$regs[0]:'暂无';
echo "
"; } ?>

www.phpzy.comtrue/php/35820.htmlTechArticlePHP运用正则表达式获取字符串中的特定字符-PHP源码 1. [PHP]代码 query("set names gb2312");$sql="SELECT * FROM `sales"`;$rows = $db->query($sql)->fetchall();foreach($rows as $row){$str = $row[detail]; preg_match("/[".chr(0...

相关文章

PHP之友评论

今天推荐