echo $name{0}; 

See http://us2.php.net/manual/en/function.substr.php for more...

> -----Original Message-----
> From: Ahmed Abdel-Aliem [mailto:[EMAIL PROTECTED] 
> Sent: Monday, December 20, 2004 1:00 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] first letter
> 
> hi
> if i have for example this variable
> 
> $name = "John";
> 
> how can i echo the first letter only so the result on the 
> browser will be "J"
> 
> can anyone help ?
>  
> 
> 
> --
> Ahmed Abdel-Aliem
> www.ApexScript.com
> 
> --
> PHP General Mailing List (http://www.php.net/) To 
> unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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

Reply via email to