运行 ❯
获取您自己的
PHP
服务器
×
更改方向
更改主题,深色/浅色
转至 Spaces
<!DOCTYPE html> <html> <body> <?php $input = [ "It is 5 o'clock", "40 days", "No numbers here", "In the year 2000" ]; $result = preg_filter('/[0-9]+/', '($0)', $input); print_r($result); ?> </body> </html>
Array ( [0] => It is (5) o'clock [1] => (40) days [3] => In the year (2000) )