fork download
  1. <?php
  2. $array = array("uno", "dos", "tres");
  3. $string = implode(", ", $array);
  4. echo substr_replace ($string, " y ", strrpos($string, ","), 2);
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
uno, dos y tres