Re: Wrong code in post.
| From: | Allowee | Date: | Thu, 11 Sep 2003 12:39:12 +0000 |
| Subject: | Re: Wrong code in post. | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969356280@lists.php.net to get a copy of this message | ||
Hi,
That note has been edited,
which is esayer then deleting and re-submtting.
- Vincent
On Thursday 11 September 2003 14:25, Martin Krøis wrote:
> Hello, hope this is the right adress:
>
> I (mkr@binarywerks.dk) just recently added a note the page:
> http://dk2.php.net/bin2hex, but
> discovered that the way I wrote the code is useless or at least quite
> akward (it's not gone online yet as I write this)
>
> I'd like to change it if possible.
>
> I am sorry about the error, and I hope you can change it or at least delete
> my note (and notify me) so I can resubmit it :\
>
> Here's the better code:
>
> #!/usr/bin/php4 -q
> <?
> $progress1=".";
> $progress2=":";
>
> $progress=$progress1;
>
> function hex2bin($hexdata)
> {
> for ($i=0;$i<strlen($hexdata);$i+=2)
> {
> $bindata.=chr(hexdec(substr($hexdata,$i,2)));
> }
>
> return $bindata;
> }
>
> for($i=0;$i<50000; $i++)
> {
> sleep(1);
> echo ($progress==$progress1) ? $progress=$progress2 :
> $progress=$progress1;
> echo hex2bin("08");
> }
> ?>
>
> Thank you for your great work on PHP!!!
>
> Kind regards,
>
> Martin K.