You are here: Re: Is using "unused" characters as temporary markers safe? « All PHP « IT news, forums, messages
Re: Is using "unused" characters as temporary markers safe?

Posted by ZeldorBlat on 12/07/05 02:33

>Is it safe to use these characters, or is there any danger
>the same characters will somehow show up unbidden in the
>user input text and mess up our text segmenting and
>reassembly?

Sure it's safe to do that, and sure there's a danger that they will
show up in user-submitted data.

Just make sure that you pick characters that don't have some other
meaning (like null or \n) but have an obvious equivalent (which, for
most of them, will be an empty string). Look at ASCII values 1 - 31.

Before you do your processing, just replace any characters that you've
reserved with nothing (or a space, or something else as you see fit):

$my_special_chars = array(chr(1), chr(2), chr(3));
$input = str_replace($my_special_chars, '', $input);
//process $input

 

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

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