John Lim,Hello! Thank you so much. How stupid I am to ignore the CHR function! by the way,do you have any idea about converting a number,which is larger than 255,into a byte stream? ======= 2004-02-25 20:20:00 ======= >The most elegant way is probably: > ><?php >for ( $i = 0; $i <=255; $i++ ) >Dictionary[] = chr($i); >?> > >"Meteorlet Woody" <meteorlet@xxxxxxxxxxx> wrote in message >news:20040225104529.D9D0010A3EE1@xxxxxxxxxxxxxx >> >> I got it. >> >> <?php >> for ( $i = 0; $i <= 255; $i++ ) >> { >> $Dictionary[] = sprintf("%c",$i); >> } >> ?> >> >> ======= 2004-02-25 18:00:06 ======= >> >> >Hi,everyone! >> > >> > When I want to create a character dictionary,I meet a problem. >> >The problem is that how to put the characters (256 ASCII,including >nonprintable) >> >in an array in one loop. >> > >> > I can do like this: >> > <?php >> > Dictionary[] = "\x00"; >> > Dictionary[] = "\x01"; >> > ...... >> > Dictionary[] = "\xFF"; >> > ?> >> > >> > But when I want to do by using loop,it doesn't work. >> > <?php >> > for ( $i = 0; $i <=255; $i++ ) >> > Dictionary[] = "\x$i"; // it doesn't work!!! >> > ?> >> > >> >Is there anyone who has any idea or hint to solve this problem? >> >Thank you so much in advance. >> > >> >Meteorlet >> >meteorlet@xxxxxxxxxxx >> >2004/2/25 >> > >> >-- >> >PHP Windows Mailing List (http://www.php.net/) >> >To unsubscribe, visit: http://www.php.net/unsub.php >> > >> >> = = = = = = = = = = = = = = = = = = = = >> >> Meteorlet Woody >> meteorlet@xxxxxxxxxxx >> 2004-02-25 >> > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > = = = = = = = = = = = = = = = = = = = = Meteorlet Woody meteorlet@xxxxxxxxxxx 2004-02-25