I've searched this forum about this, but didn't find anything.
I'm writing some PHP stuff, trying to read all the information I can out of the host list. Everything works fine, but I have a problem, understanding the 4 bytes of Cars-Ulong variable.
This peace of code gets me the 4 bytes of the car information of a server:
Here, the host list has been retrieved in the usual way from LFSW and is stored in a huge string variable.
Now I have a string of 4 letters in $tmp. How can I convert this into a ULONG number?
I suppose, if I have the correct value as unsigned long int, I can convert it to a binary string by using
Then I can parse the string for 0's and 1's to check, which cars are enabled on that server.
I would appreciate any help!
Thanks in advance,
HorsePower
I'm writing some PHP stuff, trying to read all the information I can out of the host list. Everything works fine, but I have a problem, understanding the 4 bytes of Cars-Ulong variable.
This peace of code gets me the 4 bytes of the car information of a server:
<?php
$tmp = "";
for ($w=0; $w<4; $w++) $tmp .= $this->HostList[$x++];
?>
Now I have a string of 4 letters in $tmp. How can I convert this into a ULONG number?
I suppose, if I have the correct value as unsigned long int, I can convert it to a binary string by using
<?php
$carsbinarystring = decbin(carsulongvalue);
?>
I would appreciate any help!
Thanks in advance,
HorsePower