A php variable contains the following string:
text text2 item1 item2
text
text2
$str = "Hello World!\n\n"; echo chop($str); output : Hello World!