Use the explode(":",$str) function to split the string -, if there is such data in $st [Transaction time: 2019-04-23 19:34:45] you want to get the complete data when splitting Time 2019-04-23 19:34:45, how to operate?
Alone882019-04-26 14:37:54
$str ='【交易时间:2019-04-23 19:34:45】'; $patt ='/【交易时间:(.*)】/'; $str1 = ""; $str2=preg_replace($patt,$str1,$str); echo $str2;
One of the methods
But if the colon after your transaction time is in Chinese, you can directly intercept the Chinese colon