PHP Extract numbers from a string

前端 未结 8 1501
傲寒
傲寒 2021-01-28 08:23

I want to extract numbers from a string in PHP like following :

if the string = \'make1to6\' i would like to extract the numeric charac

8条回答
  •  滥情空心
    2021-01-28 08:47

    
    

    A regex seems really unnecessary here since all you are doing is checking is_numeric() against a bunch of characters.

提交回复
热议问题