Hello, I am trying to find out out many numbers there are in a string. So if I have: Jason90 I would want to get those values 9 and 0 and know that there are two integers. Thank You, Jason
hello here is a lite example <?php $ms="Site321"; $string = ereg_replace("[^0-9]", "",$ms); echo $string; ?> PHP:
You may be looking for something more like this: <?php $subject = "GreenWithEnvy15"; preg_match_all('/[0-9]/', $subject, $matches); $count = count($matches[0]); echo $count; //echos number of integers in $subject ?> PHP:
Hi, if you want get / print the value of numbers , you can use this code in the bottom of the "GreenWithEnvy" code for ($i = 0 ; $i < $count ; $i++ ) { echo $matches[0][$i]; echo '<br/>'; } Soman