search

Home  >  Q&A  >  body text

explode function splits an array

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?

书声书声2088 days ago1389

reply all(2)I'll reply

  • Alone88

    Alone882019-04-26 14:37:54

    QQ截图20190426143417.png

    $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

    reply
    0
  • Alone88

    Alone882019-04-26 14:27:36

    Can be intercepted through regular expressions

    reply
    0
  • Cancelreply