a simple function for return number from string in php
问题 I want capture Rank from this code : $RankStr = 'var trafficstatsSnippet = "/site/trafficstats;pysa1bpbPOVl6Wm5d4Zv4nKXKdM%3D /aahoonet.com/?adult=&category=&rank=1234567";' I use this code : $NewPOS = strpos($RankStr, "rank="); $SRank = substr($RankStr, $NewPOS + 5, 10); echo $SRank; because of RANK code variable from (1 - 25,000,000) , i use above code by selecting maximum 10 charachters after starting position of rank= plus 5 further index. so this function return 1234567"; and after that