Re: Need to read a double value from a binary file
| From: | Rasmus Lerdorf | Date: | Thu, 14 Nov 2002 07:02:18 +0000 |
| Subject: | Re: Need to read a double value from a binary file | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-16937@lists.php.net to get a copy of this message | ||
$float = (float)$string;
On Tue, 12 Nov 2002, Juan Carlos Gonzalez wrote:
> Hi all! I need to read 8 bytes from a binary file (shp file) and cast it to
> its double value...
>
> I'm having problems because PHP casts it automaticlly to a string using
> fread; I can't find the function to cast it correctly, because floatval only
> removes the non-numeric parts of the variable, but it doesn't cast it
> completly...
>
> I already did a little program in C++ and it casts it perfectly, but I can'
> find the way to do it in php!
>
> Any help will be appreciated!
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>