fork download
  1. <?php
  2.  
  3. $vetor = array("Pera", "Uva", "Melao", "Morango");
  4. $separado = implode(",", $vetor);
  5. $pos = strripos($separado, ',');
  6. $string = substr_replace($separado, ' e ', $pos, 1);
  7. $string .= '.';
  8. echo $string;
  9. ?>
Success #stdin #stdout 0.01s 24448KB
stdin
Standard input is empty
stdout
Pera,Uva,Melao e Morango.