Ver originalfunction separar($cap){ $ca = strrev($cap); preg_match_all('/[0-9]{1,3}/',$ca,$capital); $num = count($capital[0])-1; $c = ''; for($i=0;$i<=$num;$i++){ $c .= $capital[0][$i].' '; } return strrev($c);}