我有一個字符串,例如: /test/
,我想僅保留小寫字母。 如何使用preg_replace
來做到這一點?正則表達式:全部替換爲'',小寫字母除外
$string = '/test/';
$new_string = preg_replace('?????', '', $string);
$new_string = 'test';
我有一個字符串,例如: /test/
,我想僅保留小寫字母。 如何使用preg_replace
來做到這一點?正則表達式:全部替換爲'',小寫字母除外
$string = '/test/';
$new_string = preg_replace('?????', '', $string);
$new_string = 'test';
你想要做的,因爲我不明白。你想刪除'/'? – Robert