character-trimming

Why is rtrim removing more characters, and giving weird output?

北城余情 提交于 2020-01-14 06:08:28
问题 I am trying to remove last few characters from the string using rtrim . i have string "Scryed (download torrent) - TPB" i want output string "Scryed" e.g. $title_t = "Scryed (download torrent) - TPB"; echo ($title_t) ; echo "\n"; $title = ( rtrim ($title_t, "(download torrent) - TPB") ); echo ($title) ; gives Scryed (download torrent) - TPB Scry Why is that ? expected output is Scryed (download torrent) - TPB Scryed 回答1: It's because rtrim 's second parameter is list of characters. Not a