Given a string S1, replace "\n", using str_replace(), with a special token " xx--99---2 ", where the special token has both a leading and trailing blank, to give string S2. Now explode S2, and do your operation on the exploded result. but be careful that the operations done will not affect the special token. Subsequently implode the new results to give the string S3. Finally replace the special token using str_replace(), with "\n" to give S4, and your task is complete.