The improvement to your function, proposed by Sanjay Mantoor, works
excellent. There´s no need to find any other way.


        //here we use the function you proposed, improved by Sanjay Mantoor:
        function return_int($value){
                if (ctype_digit($value))
                                echo $value."\t";
                                return true;
                                                return false;

        //First, we get the string from the a form:
        //now we construct an array with characters in the string:
        $value =  str_split($num);
        //here we filter the array looking for........ you know:
        $value_new = array_filter($value, "return_int");
        //This programming exercise comes from an eMail I recived yerterday.

        //How can I find the integers inside a string?

        //The original an a good answer are in the folder of the site. Read
        //Wednesday, july 23th, 2008.

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to