DEV Community

loading...

Discussion on: Daily Challenge #1 - String Peeler

Collapse
celyes profile image
Ilyes Chouia • Edited

PHP:


function removeFirstAndLastLetter($text){
    return substr($text, 1, -1);
}
echo removeFirstAndLastLetter("Oh no, I lost two letters");

// Outputs : h no, I lost two letter