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?
终会与你在人海相遇
$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
Can be intercepted through regular expressions
One of the methods
But if the colon after your transaction time is in Chinese, you can directly intercept the Chinese colon
Can be intercepted through regular expressions