PHP Using RegEx to get substring of a string

前端 未结 4 481
自闭症患者
自闭症患者 2020-12-08 18:30

I\'m looking for an way to parse a substring using PHP, and have come across preg_match however I can\'t seem to work out the rule that I need.

I am parsing a web p

4条回答
  •  猫巷女王i
    2020-12-08 18:39

    $string = "producturl.php?id=736375493?=tm";
    $number = preg_replace("/[^0-9]/", '', $string);
    

提交回复
热议问题