basic-problem / get-last-index--string.php

GEt Last Index String

<?php

function getLastDigitString($string)
{
    return $string[strlen($string) - 1];
}


echo getLastDigitString("Hello World"); // Output: d

GEt Last Index String | basic-problem | Study Notes | Ferdyhape