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

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

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

asp.net - call stack missing info on mono with apache and mod_mono -