您好,登錄后才能下訂單哦!
$string = 'April 15, 2003';
$pattern = '/(\w+) (\d+), (\d+)/i';
$replacement = '${1}1,\3';
//$replacement = '${1}1,$3';
//$replacement = '${1}1,{3}';
echo preg_replace($pattern, $replacement, $string);
echo '<br/>';
//-----------------------------
$string = 'The quick brown fox jumped over the lazy dog.';
$patterns = array();
$patterns[0] = '/quick/';
$patterns[1] = '/brown/';
$patterns[2] = '/fox/';
$replacements = array();
$replacements[2] = 'bear';
$replacements[1] = 'black';
$replacements[0] = 'slow';
echo preg_replace($patterns, $replacements, $string);
echo '<br/>';
//---------------------------------
//$d = $db->select('select * from <{:task}> limit 2');
self::$_sql = preg_replace('/<{:\s*(.*?)\s*}>/', $this->_prefix . '\1', $sql);
$this->_res = mysql_query(self::$_sql, $this->_db);
//---------------------------------
if (preg_match('/^p-(\d+)$/', $segment3, $m)) {
$page = intval($m[1]);
}
else if (preg_match('/^\d+$/', $segment3)) {
$task_type = intval($segment3);
if (preg_match('/^p-(\d+)$/', $setment4, $m2)) {
$page = intval($m2[1]);
}
}
preg_match_all("/{([^\}\{\n]*)}/e",$contents , $source);
echo preg_replace("/{([^\}\{\n]*)}/e", " ", $contents);
return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
$str = "http://112.125.116.137:9012/llys//lldoctor";
$pattern = '/(http:\/\/[^\/]+\/)(.*)/i';
preg_match($pattern,$str,$result);
echo "aaaaaa" ; dump($result);
preg_match("/php/i", "PHP is the web scripting language of choice.",$result);
echo "bbbb" ; dump( $result);
preg_match('/http:\/\/[^\/]+\//i', $str ,$result);
echo "bbbb" ; dump( $result);
exit;
echo $this->serinfo ."|". U('Home/Public/psysSendMessages');
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。