php-general Digest 4 Feb 2013 05:49:57 -0000 Issue 8111

Topics (messages 320147 through 320148):

Re: Integer
        320147 by: Ron Piggott

Re: error_log() bug on PHP 5.4.11?
        320148 by: J.S.

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---


Thank you for the help.  Very much appreciate it.



Ron Piggott



www.TheVerseOfTheDay.info

-----Original Message----- From: Shawn McKenzie
Sent: Saturday, February 02, 2013 1:43 PM
To: php-gene...@lists.php.net ; Ron Piggott
Subject: Re: Integer

On 02/01/2013 10:40 PM, Ron Piggott wrote:
In the following the “2.” means a moderator response and “25” is the account # of the moderator.

<?php

$author = 2.0000000000000000000000025

?>

How can I get the 25 by itself?
- I want to drop the “2.” and remove all the zero’s

Would it be best to turn this into a STRING?

Any suggestions?


Ron Piggott



www.TheVerseOfTheDay.info


Yeah needs to be a string:

$author = "2.0000000000000000000000025";

list($a, $b) = explode('.', $author);

echo (int)$a . ' ' . (int)$b;
--- End Message ---
--- Begin Message ---
The culprit was Chrome's HTML Validator extension. It triggered an 
additional request for the page doing the logging therefore resulting in 
logging of two identical entries. Once I disabled the extension the problem 
went away.

Sorry for the false alarm.

J.S.

""J.S."" <h...@webserverone.com> wrote in message 
news:73.47.09318.7bde8...@pb1.pair.com...
> Hi,
>
> When I call error_log() to log a message to the log file, I end up with 
> duplicate entries. Here is a minimal test script which reproduces the 
> problem for me:
>
> <?php
> ini_set('error_log', 'C:\Apache2\htdocs\myapp\app\logs\error_log');
> error_log('some log message that, via a bug, will be logged twice');
> ?>
>
> will log:
>
> [30-Jan-2013 09:41:13 UTC] some log message that, via a bug, will be 
> logged twice
> [30-Jan-2013 09:41:13 UTC] some log message that, via a bug, will be 
> logged twice
>
> If it matters, I am running the VC9 x86 Thread Safe build of PHP 5.4.11 on 
> a Windows XP box but I had seen this problem in PHP 5.3.6 as well. I am 
> running Apache 2.2 for Web server.
>
> Can somebody confirm whether this is a bug? I checked the bug database on 
> php.net but did not find anything relevant.
>
> Best regards
>
> J.S.
> 



--- End Message ---

Reply via email to