3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "087777807209"; // Original string $replacement = "62"; // What you want to replace the last character with // The final string $final = $replacement.substr($string, 0, 0); echo $final;

preferences:
54.97 ms | 402 KiB | 5 Q