Reply to Re: trying to make characters safe for my RSS feed

Your name:

Reply:


Posted by Colin Fine on 10/13/05 22:30

lkrubner@geocities.com wrote:
> Okay, the function doesn't work:
>
> http://www.whatisliberalism.com/pdsFiles/page2533.xml
>
> All the white space got replaced, but the entity that is kill the feed
> is still there.
>
> What is wrong with this function?
>
> function command($string=false) {
> $howMany = strlen($string);
>
> $newString = "";
> for ($i=0; $i < $howMany; $i++) {
> $char = $string[$i];
> $asciiNum = ord($char);
> if ($asciiNum > 32 && $asciiNum < 128) {
> $newString .= $char;
> } else {
> $newString .= "'";
> }
> }
>
> return $newString;
> }
>
I don't know what's wrong with its operation, but you're reinventing the
wheel.

Have a look at http://uk2.php.net/manual/en/function.strtr.php

Colin

[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

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