作者ialk (175)
看板PHP
标题[请益] PCRE 看不懂..
时间Tue Mar 20 07:34:03 2007
$str = 'comma, "separated ""values""", are , "shown, here", "for\nyou " ';
$delim = ',';
$quote='"';
$new = str_replace("{$quote}{$quote}", $quote, $string);
$matches = array();
preg_match_all("/\s*({$quote}?)(.*?)\\1\s*(?:{$delim}|$)/",$new, $matches);
第四行把连续两个 '"' 换成了一个 '"'
接着那串/\s*({$quote}?)(.*?)\\1\s*(?:{$delim}|$)/
^^^^^^^^
请问这段是什麽意思 ?
最後的matches[2]又是什麽 @@
拜托大家教我
谢谢
--
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.229.163.4
※ 编辑: ialk 来自: 61.229.163.4 (03/20 07:34)
1F:推 GaryJuang:正规表示式..google一下很多资料. 03/20 07:56
2F:推 ialk:想问一下 //1是什麽意思..我找不到 ~"~ 03/20 13:47