You are here: Re: Regular Characters to HTML entities « PHP Programming Language « IT news, forums, messages
Re: Regular Characters to HTML entities

Posted by Justin Koivisto on 11/19/38 11:47

grantges@gmail.com wrote:
> Hi -
>
> Does anyone know of a php function that takes a given character - ex.
> "A" without quotes and converts it into &#65 ?
>
> If not a single function, what is the best way to accomplish this. The
> htmlentities function suite handle special characters, but my goal is
> to change average everyday letters of the alphabet as well.
>
> Thanks -
> Bert
>

function str2entities($email){
$str='';
for($j=0;$j<strlen($email);++$j){
$str.='&#'.ord($email{$j}).';';
}
return $str;
}


--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com

 

Navigation:

[Reply to this 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

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