fork download
  1. <?php
  2.  
  3. $string = 'oi, voce, tem, problema, pra, entender, isso?';
  4.  
  5. if (preg_match_all("/[a-z0-9\-\,]{2,}/", $string, $output_array) !== false) {
  6. foreach($output_array[0] as $word) {
  7. echo $word;
  8. }
  9. }
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
oi,voce,tem,problema,pra,entender,isso