Regex str_replace

前端 未结 2 549
灰色年华
灰色年华 2020-12-18 17:58

Would it be possible to incorporate a str_replace method with a regular expression, designed to catch url strings in a simple html < textfield > input type?<

相关标签:
2条回答
  • 2020-12-18 18:25

    What you're looking for is preg_replace:

    $pg = preg_replace('{regex goes here}', '{replacement goes here}', $pg);
    
    0 讨论(0)
  • 2020-12-18 18:35

    Check out preg_replace here, this is what you are lookin for.

    // From the documentation.
    preg_replace($regularExpression, $replacement, $subject); 
    
    0 讨论(0)
提交回复
热议问题