Replace at the 5th position from the end of the string in PHP
Description
The following code shows how to replace at the 5th position from the end of the string.
Example
<?php
echo substr_replace("Hello world","earth",-5);
?>
The code above generates the following result.