dAivEd Posted June 26, 2009 Report Share Posted June 26, 2009 Ir kautkads teksts piemeram "SHODIEN IR 5 DATUMS ?" No shi visa paliek tikai 5 Quote Link to comment Share on other sites More sharing options...
indoom Posted June 26, 2009 Report Share Posted June 26, 2009 echo preg_replace('/[^\d]/','',"SHODIEN IR 5 DATUMS ?"); Quote Link to comment Share on other sites More sharing options...
dAivEd Posted June 26, 2009 Author Report Share Posted June 26, 2009 Labi buutu ja vinsh vel atstatu atstarpes, lai sanaktu PIEM "Shodien ir 15 12 menesha" Un tad atstai "15 12" nevis ka tava piemera 1512 Quote Link to comment Share on other sites More sharing options...
marrtins Posted June 26, 2009 Report Share Posted June 26, 2009 $data = preg_replace('/[^\d\s]/','',$data); $data = trim(preg_replace('/[^\s+]/',' ',$data)); Apmēram. Nav testēts. Quote Link to comment Share on other sites More sharing options...
v3rb0 Posted June 27, 2009 Report Share Posted June 27, 2009 $s = 'Shodien ir 15 12 menesha'; if(preg_match_all('/\d+/', $s, $m)) { echo implode(' ',array_pop($m)); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.