Modifying Chars in a String As If They Were Bytes

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

Post Reply
lbiswim
Forum Newbie
Posts: 1
Joined: Mon Jul 05, 2010 9:26 pm

Modifying Chars in a String As If They Were Bytes

Post by lbiswim »

How would I go about modifying chars in a string as if they were bytes?
I need to read data from a file then modify it byte by byte but nothing I have tried has worked. I tried using ord chr and strlen
but the output seems to be rounded to conform to some crazy standards where the range isn't 0-255

Thanks
John
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Modifying Chars in a String As If They Were Bytes

Post by Jonah Bron »

Chr() and ord() should work properly. Can you post the code you tried, or at least a little demo script that you don't think works?
Post Reply