<?php$i = new ArrayIterator(array(1,7,9,null,40,'dude',3));$filtered = new RegexIterator($i, '/\d+/');foreach($filtered as $value) { echo $value . PHP_EOL;}