Anyone know of a very fast way to replace the last occurrence of a string with another string in a string?
Note, the last occurrence of the string might not be the last characters in the string.
Example:
$search = 'The';
$replace = 'A';
$subject = 'The Quick Brown Fox Jumps Over The Lazy Dog';
Expected Output:
The Quick Brown Fox Jumps Over A Lazy Dog