我想从“字符串2015-08-20”只提取日期部分。preg_replace 变成数字
$original = "string 2015-08-20";
// Trying to remove all but numbers and dashes
$date = preg_replace("#[^0-9-]#iu", '', $original);
// Expecting "2015-08-20"
echo $date;
// But ends up with "1602015-08-20"
为什么我会在我的字符串前得到“160”?
'$ date = preg_replace(“#^。*?;#”,'',$ original);' –
[** norepro **](https://3v4l.org/FILIUe) – Rizier123