in reply to string stripping
The error message you are getting is telling you that you didn't declare $n, but since you didn't preview your posting, and didn't use code tags, your code is unreadable, so you probably won't get a lot of help with it.