RE: First Character In A String

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$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@xxxxxxxxx] 
Sent: Sunday, January 21, 2007 3:44 PM
To: php-general@xxxxxxxxxxxxx
Subject:  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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux