RE: [PHP] First Character In A String
| From: | Peter Lauri | Date: | Sun, 21 Jan 2007 13:51:03 +0000 |
| Subject: | RE: [PHP] First Character In A String | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247502@lists.php.net to get a copy of this message | ||
$firstchar = substr($string, 0, 1);
Read www.php.net/substr
Best regards,
Peter Lauri
www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free
-----Original Message-----
From: Christopher Deeley [mailto:chrisdeeleyuk@gmail.com]
Sent: Sunday, January 21, 2007 3:44 PM
To: php-general@lists.php.net
Subject: [PHP] First Character In A String
Can anyone tell me if there is a function to return the first letter in a
string, such as:
$surname="SMITH";
$forename="ALAN";
Is there a function which I can use to make $forename "A", so I can display
it as A SMITH?
Thank You In Advance