PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Joost
Forum Newbie
Posts: 2 Joined: Fri Jan 19, 2007 5:22 pm
Post
by Joost » Fri Jan 19, 2007 5:32 pm
Hello,
I came across a piece of PHP code that utilizes
I have searched the tutorials and manual but couldn't find what the function is exactly.
Anyone that can help me out ?
Garcia
Forum Newbie
Posts: 5 Joined: Tue Jan 16, 2007 7:35 pm
Post
by Garcia » Fri Jan 19, 2007 5:39 pm
Last edited by
Garcia on Fri Jan 19, 2007 5:40 pm, edited 1 time in total.
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Fri Jan 19, 2007 5:39 pm
Joost
Forum Newbie
Posts: 2 Joined: Fri Jan 19, 2007 5:22 pm
Post
by Joost » Fri Jan 19, 2007 6:01 pm
Ah, great help guys thanx!
Another one for you
What is the catch with feeding chr() integers past 255 ?
I mean, PHP takes chr(12034) without a complaint and returns an ASCII character. But how does it come up with the ASCII value for the character ?
aaronhall
DevNet Resident
Posts: 1040 Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:
Post
by aaronhall » Fri Jan 19, 2007 6:26 pm
Try this out:
Code: Select all
echo '<table>';
for($i=0; $i<3; $i++) {
echo '<tr>';
echo '<td>chr('.($i*255).')-chr('.((($i+1)*255)-1).')';
for($j=0; $j<=254; $j++) {
echo '<td>', chr($j), '</td>';
}
echo '</tr>';
}
echo '</table>';
For every 255 characters, chr() will start over at ascii(0) and continue rotating through the characters (e.g., 255=0, 256=1, 257=2,...)
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Fri Jan 19, 2007 6:32 pm
wtf? that printed out
Ï ƒå®†€Ð