Consider the following string:
Hello World
My aim is to remove all the characters prior to the last character ("d"), excluding the last character.
What is the most efficient way to accomplish this in PHP?
Consider the following string:
Hello World
My aim is to remove all the characters prior to the last character ("d"), excluding the last character.
What is the most efficient way to accomplish this in PHP?
Use substr() in php
<?php
$str = "Hello World";
echo substr($str, -1);
?>