How to substract numbers within a string in PHP? -


Say a string variable containing data data, say $ x = "OP / 12 / DIR"; The status of the number data can be changed in any case by changing the user's application to the will of the user, and slash bar can be replaced by any other character; But number data is mandatory. So what's the way to extract the number data from the string?

Change everything that is empty with no space string.

$ numbers = preg_replace ('/ [^ 0-9] * /', '', $ x);

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -