Split Name in PHP and Javascript

1 · Subin Siby · Aug. 30, 2013, 1:41 p.m.
If you have a user with a long name and want to short it because it won’t fit into the element that contains the name, you can either do it on the server or the client. In this post I am going to tell you how to accomplish this with PHP and JavaScript. Suppose We have a user named Paul Steve Panakkal (my cousin). To separate the first name, middle name and last name you can do the following in PHP :...