admin 發表於 2023-7-24 14:09:54

preg_replace()-正規式的搜索和替換

preg_replace($pattern, $replacement, $subject, [$limit])
說明:
$pattern:正規式文字字串規則
$replacement:要替換的內容
$subject:原字串
$limit:此為選項,指定替換的個數,如果省略limit 或者其值為-1,則所有的匹配項都會被替換

程式碼範例:



執行結果:


頁: [1]
查看完整版本: preg_replace()-正規式的搜索和替換