解决方案 »
- 求教web应用的负载均衡技术
- 请问这个函数如何写,及如何调用。
- apache老是把内存占满,100%CPU
- PHP高级群45067352限高手老鸟进
- 急!!!!mysql_select_db(): supplied argument is not a valid MySQL-Link resource
- 达人帮忙看看我的php5+smarty网站怎么出现这个问题?Creating directory: /USR
- 请问并发写入数据库,如何保持唯一性啊
- 庆国庆,散分~
- php基础,结果为什么时这样的? float(-3.0531133177192E-16)
- 已安装gd库,但仍提示Call to undefined function imagecreatefromjpeg()
- PHP数组问题,取出多维数组前面的
- 调用数据库并循环
$regex = '/大(.*?)好啊/';
$str = '大家好啊';
$matches = array();
if(preg_match($regex, $str, $matches)){
var_dump($matches);
//array(2) { [0]=> string(12) "大家好啊" [1]=> string(3) "家" }
}
$str = '大家好啊';
$matches = array();
if(preg_match($regex, $str, $matches)){
var_dump($matches);
}array(2) { [0]=> string(8) "大家好啊" [1]=> string(2) "家" }
header("Content-type: text/html; charset=gb2312");
$regex = '/大(.*?)好啊/';
$str = '大家好啊';
$str= mb_convert_encoding($str,'gb2312','UTF-8');
$regex = mb_convert_encoding($regex,'gb2312','UTF-8');;
$matches = array();
if(preg_match($regex, $str, $matches)){
var_dump($matches);
//array(2) { [0]=> string(12) "大家好啊" [1]=> string(3) "家" }
}
$str = 'a大家好啊';
$matches = array();
if(preg_match($regex, $str, $matches)){
var_dump($matches);
}array(2) { [0]=> string(9) "a大家好啊" [1]=> string(2) "家" }