|
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]
|