|
Posted by Mark on 11/24/06 05:33
petersprc wrote:
> To get the data two chars at a time, you could do:
>
> $len = strlen($data);
> for ($i = 0; $i < $len; $i += 2) {
> $str = substr($data, $i, 2);
> echo "String is \"$str\".\n";
> }
>
> To access using a streams interface, you could dump the data into a
> temporary file, then read it in. Or create a stream wrapper with
> stream_wrapper_register.
Well, the two characters at a time thing doesn't work very well,
because it's not always just two characters, and I've been doing a lot
of fseek-ing. The temp file solution could work, but that just sounds
like a horrible thing to do. Thanks anyway.
[Back to original message]
|