That new error, "Parse error: syntax error, unexpected $end", means you are missing a closing bracket. A right curly bracket, } needs to match up with one of the opening ones, {.
Another problem with your new code is although you have now defined a strip_newlines function, it is never actually called, plus it is being defined in a loop for no reason.
Those were the problems, cemtex's code should get you on track.
|