TShopping

標題: PHP廢棄函數ereg_replace(),如何用preg_replace()替換? [打印本頁]

作者: woff    時間: 2021-10-7 23:24
標題: PHP廢棄函數ereg_replace(),如何用preg_replace()替換?
ereg_replace()是個使用正則的replacestr_replace()
ereg_replace ( string $pattern , string $replacement , string $string ) : string
preg_replace ( mixed $pattern , mixed $replacement , mixed $subject [, int $limit = -1 [, int &$count ]] ) : mixed
preg_replace()是目前的推薦方案,必選參數3個,可選參數3個。基本上可以覆蓋 只不過是參數的具體用法不同。返回值是基本上一致的。ereg_replace()



文章出處





歡迎光臨 TShopping (http://www.tshopping.com.tw/) Powered by Discuz! X3.2