PHP string function chop() does not give desired output

Viewed 264

The following code:

<?php
    $str='Who are you?';
    echo chop($str,'you?').'<br>';
    echo chop($str,'are you?').'<br>';
?>

gives me the output:

Who are
Wh

Why the second output is

Wh

and not

who
2 Answers
Related