看板 PHP 關於我們 聯絡資訊
$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)
GaryJuang:正規表示式..google一下很多資料. 03/20 07:56
ialk:想問一下 //1是什麼意思..我找不到 ~"~ 03/20 13:47