fork download
  1. <?php
  2.  
  3. $vetor = array("Pera", "Uva", "Melao", "Morango");
  4. $ultimo = array_pop($vetor);
  5. $string = implode(', ', $vetor);
  6. $string.= ' e '.$ultimo.'.';
  7. echo $string;
Success #stdin #stdout 0.02s 24400KB
stdin
Standard input is empty
stdout
Pera, Uva, Melao e Morango.