Showing posts with label php substr word safe. Show all posts
Showing posts with label php substr word safe. Show all posts

Thursday, July 19, 2012

Substract a string on a word boundry using regexp

There are many answers on this problem, but i found one very easy to implement, lightweight, and fast.
I think the fewer code lines, the better, so why not using a regexp instead of substr?