Jump to content

eliteskills

Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

eliteskills's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thhhhhhhhhhank you!!! You have saved precious time. I just finished making this disgusting function which does the same thing. function bin2float($blah){ $arr=str_split(bin2hex($blah)); $out=0; $pow= strlen($blah); foreach($arr as $v){ $pow--; $out+=intval($v,16)*pow(16,$pow); } return $out; } echo bin2float(file_get_contents('testplz.bin')); Thanks for the much more elegant solution.
  2. I have a binary file which only has 4 bytes "FFFFFFEE". I just want to put it in a variable equaling 4294967278. How I've failed so far: <? $foo= bin2hex(file_get_contents('testplz.bin')); // This correctly creates the hex number but on closer inspection it just turned it into a string. $foo=intval(bin2hex(file_get_contents('testplz.bin')),16); // This works up until the value exceeds 2147483647, there's a function called floatval but it doesn't accept the ,16 argument and doesn't accept binary either settype($foo, "float"); // Any variation of bin2hex, casting, etc don't seem to give me a correct answer echo (float)bin2hex(file_get_contents('testplz.bin')); ?> Please help ='/, I can't proceed with what I need to finish.
  3. [!--quoteo(post=383068:date=Jun 12 2006, 09:05 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 12 2006, 09:05 PM) [snapback]383068[/snapback][/div][div class=\'quotemain\'][!--quotec--] These are probably restricted by your webserver. You should really contact the web hosting company. If your server has cPanel installed, you can use its built-in Zip extractor. [/quote] I have a dedicated server with no cpanel. I can unzip things, just not automatically in a shell script
  4. I'd like to unzip a file automatically in php. If I run unzip.php which contains [code]<? system('unzip -o xml.zip')[/code] It works in ssh, but it does nothing if I just go directly to the file unzip.php on my server through http request on firefox. How do I set the permissions so that it allows me to unzip the file just by going to the php page?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.