<?php
function clean($data){
$data=preg_replace('/[^0-9]+/', '', $data);
$data = str_split($data);
return $data;
}
$a=clean("812z5124zdd346");
print_r($a[0]);
print_r($a[1]);
print_r($a[2]);
this will only allow numbes and create an arrary from the string, using function mode
No hay comentarios:
Publicar un comentario