The chop function removes characters from the right end of a string. It's an alias of rtrim().

    
    $sentence = "Hello World!";

    $sentenceChop = chop($sentence,"World!");

    echo $sentenceChop;
    // Hello