php - Most efficient way to get last initial? -


i'm working on custom forum. use email , password log in, , forum display first name , last initial. database stores first name , full last name.

what easiest way make abbreviate last name initial?

it uses display full name:

$name = $row['user_firstname'] . " " . $row['user_lastname']; 

thanks!

 $name = $row['user_firstname'] . " " . $row['user_lastname'][0]; 

just add [0] end first character.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -