Reply to Re: Variable Types question

Your name:

Reply:


Posted by Ken Robinson on 07/01/06 20:18

tony@tony.com wrote:
> Does PHP have a byte or character type ?
>
> If I do
>
> $email = "tony@tony.com";
> echo $email[0];
>
> I can get the letter "t"
>
> However according to the documentation (and my tests) this is not being
> extracted as a character but a string.
>
> How can I extract just the character itself ?

That is the letter itself. What, precisely are you trying to do?
>
> To test this you can do this:
>
> echo ((int)$email[0]);
> and it returns 0.

In order to get the numerical value of a character, you need to use the
ord() fuction. <http://www.php.net/ord>

Ken

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация