yosra Posted April 18, 2013 Share Posted April 18, 2013 i need to set the size of variable for example i need to right '1' into 4 bytes or 'admin' into 2 bytes could u help me please Quote Link to comment Share on other sites More sharing options...
Christian F. Posted April 18, 2013 Share Posted April 18, 2013 I'm afraid that this doesn't make any sense. What are you trying do do, which makes you think you need to do this? Is this an attempt at a bit field? Remember, the more details you give surrounding your code and problem, the more accurate and efficient help you'll get. Most of the time you might even get a better way to solve the problem on, than the one you're currently trying to employ. I suspect this will be one of those cases. Quote Link to comment Share on other sites More sharing options...
yosra Posted April 18, 2013 Author Share Posted April 18, 2013 i m tryin to create a NXCP message with http://wiki.netxms.org/wiki/Communication_Protocol_Reference_Guide for example certain filed need to be written on 4 bytes like the flag : end of file=1 i need to convert it in hex and than check the size id it's on 4 bytes or no Quote Link to comment Share on other sites More sharing options...
Barand Posted April 18, 2013 Share Posted April 18, 2013 So you had no luck with pack() and unpack() then? http://forums.phpfreaks.com/topic/276817-convert-to-bytes/?do=findComment&comment=1424207 Quote Link to comment Share on other sites More sharing options...
yosra Posted April 18, 2013 Author Share Posted April 18, 2013 no! no luck Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.