After having read a few questions already asked and checking a few other sites I'm still no further forward in finding a simple way to take a full name like say "Jake Whiteman" and trimming it down so that it would be shown on the web page as "Jake W." obviously without the speech marks round it just so there isn't any confusion there.
Anyone have any idea how to do it? I'm sure its probably just a matter of finding the white space and then trimming down the surname, I just can't seem to find a way of doing it.
Thanks in advance!
$names = explode( " ", $name );
echo $names[0]." ".$names[1][0];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With