RE: [PHP] first letter
| From: | Brandon Thompson | Date: | Mon, 20 Dec 2004 19:19:44 +0000 |
| Subject: | RE: [PHP] first letter | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-204755@lists.php.net to get a copy of this message | ||
echo $name{0};
See http://us2.php.net/manual/en/function.substr.php
for more...
> -----Original Message-----
> From: Ahmed Abdel-Aliem [mailto:me2resh@gmail.com]
> Sent: Monday, December 20, 2004 1:00 PM
> To: php-general@lists.php.net
> 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
>
>