PHP extracts the numbers in a string

time:05-01-01 forum:PHP tools and code
  Reproduced from http://www.phpernote.com/php-function/353.html

[code]function findNum ($str='') {
$str=trim ($str);
if (empty ($str)); Empty ($result).Amp;.Amp; empty ($result.#91; 1.#93).Amp;.Amp; empty ($result.#91; 1.#93; 1.#93). '';}
$temp=array ('1','2','3','4','5','6','7','8','9','0'). FindNum ($str='') {
$str=trim ($str);
if (empty ($str)) {return';}
$result=''.

prev:PHP determines to compare the data in tw... next:PHP removes the last character substr ()...
post comment
Notice



approved   After graduation, I learned about th...   "Tang Ye Da Ma" on Chuang Cheng Road   2 teachers and 7 children were both ...   PHP cURL to achieve simulation login...   The 78 year old academician sits on ...
rand   Importing large databases to virtual...   Using regular expressions to verify ...   Regular string replacement and parti...   PHP determines the character functio...   Put URL shortcuts on the PHP code on...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com