PHP's chop () string function does not give desired result
because:
(PHP 4, PHP 5, PHP 7)
chop
- Aliasrtrim()
and
(PHP 4, PHP 5, PHP 7)
rtrim
- strip spaces (or other characters) from end of line
string rtrim ( string $str [, string $character_mask ] )
So ... you feed the character's mask.
Considering "o" is in this mask, so it gets cropped
source to share
In your line you specified character_mask
, this is what it says:
character_mask : You can also specify the characters you want to split using the character_mask parameter. Just list all the characters you want to remove. With .. you can specify a range of characters.
In your case, there is an "o" in the mask, for this reason all the "o" s $str
have been removed.
source to share