php-general Digest 12 Oct 2009 18:10:52 - Issue 6387
Topics (messages 298849 through 298870):
Re: security/deployment issue
298849 by: James McLean
Re: Need unrounded precision
298850 by: Arno Kuhl
298851 by: Chetan Rane
298858 by: Diogo Neves
298862
-Original Message-
From: Andre Dubuc [mailto:aajdu...@webhart.net]
Sent: 02 January 2010 03:20 AM
To: php-general@lists.php.net
Subject: [PHP] Need unrounded precision
Hi,
I need to extract the first digit after the decimal point from a number such
as 28.56018, which should be '5'.
May be this will work
$elapsed = 28.56018;
$elapsed_rel = (int) 28.56018;
$elapsed_deci = $elapsed - $elapsed_rel;
$deci = ((int) ($elapsed_deci * 10))/10;
$final = $elapsed_rel + $deci;
With regards,
Chetan Dattaram Rane | Software Engineer | Persistent Systems
chetan_r...@persistent.co.inĀ |
cant http://us3.php.net/manual/en/function.set-exception-handler.php be used ?
?php
function exception_handler($e) {
//mail('to', 'exception', $e-getMessage());
}
set_exception_handler('exception_handler');
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Hello,
We use Php-cgi.exe as FastCGI with our own custom WebServer on Windows
Server
What to choose, VC9 x86 Non Thread Safe or VC9 x86 Thread Safe ?
We have these enviroment variable :
PHP_FCGI_CHILDREN: 8
Thanks you by advance
stephane
--
Http://www.arkadia.com/fra/
2009/10/11 Eric Bauman baum...@livejournal.dk:
As before, please feel free to insult my code. ;-) Any and all feedback is
of course most appreciated.
I know you're more concerned with structure, but your checkInt()
method is arguably buggy/has an un-noted assumption. It accepts ints
formatted
- Original Message
From: loki loki5100-newsgr...@yahoo.fr
To: php-general@lists.php.net
Sent: Mon, October 12, 2009 3:13:41 AM
Subject: [PHP] VC9 x86 Non Thread Safe or VC9 x86 Thread Safe ?
Hello,
We use Php-cgi.exe as FastCGI with our own custom WebServer on Windows Server
On Sun, Oct 11, 2009 at 01:17:00PM -0700, Jim Lucas wrote:
Stephan Ebelt wrote:
On Mon, Oct 05, 2009 at 05:48:32PM -0700, Jim Lucas wrote:
Here is a problem that I have had for years now. I have been trying to
come up
with the perfect solution for this problem. But, I have come down to
2009/10/12 Stephan Ebelt s...@shared-files.de:
as far as I understood/use it: I try to hardcode as many workable defaults in
the vo class as possible (ie. see $subject in the example). Then I create
objects
by passing result records from the database (arrays) to the constructor. That
either
A simple way to do that would be:
$elapsed = strval( 28.56018 );
$pos = strpos( $elapsed, '.' );
echo $elapsed[ ++$pos ];
On Sat, Jan 2, 2010 at 2:20 AM, Andre Dubuc aajdu...@webhart.net wrote:
Hi,
I need to extract the first digit after the decimal point from a number
such
as 28.56018,
I have some code which will loop over the whole $_POST array, runs it
through mysql_real_escape_string and then writes it all back to the array
again, which seams to work. Are there any incompatibility problems or such
like with writing into the $_POST or $_GET array?
function clean_post()
hessi...@hessiess.com wrote:
I have some code which will loop over the whole $_POST array, runs it
through mysql_real_escape_string and then writes it all back to the array
again, which seams to work. Are there any incompatibility problems or such
like with writing into the $_POST or $_GET
Jay Ess wrote:
hessi...@hessiess.com wrote:
I have some code which will loop over the whole $_POST array, runs it
through mysql_real_escape_string and then writes it all back to the array
again, which seams to work. Are there any incompatibility problems or
such
like with writing into the
But, first, you need to use get_magic_quotes_gpc() to see if magic_quotes_gpc
is
turned on. If so, you need to run stripslashes() on your variables before you
run the mysql_real_escape_string() on them.
if ( get_magic_quotes_gpc() ) {
$_POST = array_map('stripslashes', $_POST);
When shell command returns a specially crafted string, I get an empty
array as $output of exec(), instead of the string. I can very easily
reproduce this issue as follows:
Put the following lines in bug.php:
?php
exec('php echostr.php', $output);
print_r($output);
echo \n;
?
Then put the
Confirmed, it also happens to me on Linux, PHP version:
PHP 5.2.4-2ubuntu5.7 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21
2009 19:52:39)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
And adding a single character to the echoed string makes
Hmmm... Didn't think about this, but % only works with int values
it was just future prof precaution since this statement is false for many other
languages.
In few words I am not sure PHP6 does the same ... never mind so far
Regards
Hmmm... Didn't think about this, but % only works with int values
it was just future prof precaution since this statement is false for many
other languages.
In few words I am not sure PHP6 does the same ... never mind so far
Good to know. In that case, I would probably just use intval()
Couldn't this be done with just simple math functions?
indeed:
$a = 28.56018;
$b = $a * 10 % 10 0;
Regards
_
Windows Live Hotmail: Your friends can get your Facebook updates, right
-Original Message-
From: Diogo Neves [mailto:dafne...@gmail.com]
Sent: Monday, October 12, 2009 9:19 AM
To: Andre Dubuc
Cc: php-general@lists.php.net
Subject: Re: [PHP] Need unrounded precision
A simple way to do that would be:
$elapsed = strval( 28.56018 );
$pos = strpos(
Couldn't this be done with just simple math functions?
indeed:
$a = 28.56018;
$b = $a * 10 % 10 0;
Hmmm... Didn't think about this, but % only works with int values, so
$b = $a * 10 % 10;
Should work as well.
Jaime
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
On Mon, 2009-10-12 at 13:21 -0300, Jonathan Tapicer wrote:
Confirmed, it also happens to me on Linux, PHP version:
PHP 5.2.4-2ubuntu5.7 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21
2009 19:52:39)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend
On Mon, Oct 12, 2009 at 01:44:56PM +0100, David Otton wrote:
2009/10/12 Stephan Ebelt s...@shared-files.de:
as far as I understood/use it: I try to hardcode as many workable defaults
in
the vo class as possible (ie. see $subject in the example). Then I create
objects
by passing
On Mon, Oct 12, 2009 at 2:10 PM, Soner Tari so...@comixwall.org wrote:
On Mon, 2009-10-12 at 13:21 -0300, Jonathan Tapicer wrote:
Confirmed, it also happens to me on Linux, PHP version:
PHP 5.2.4-2ubuntu5.7 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21
2009 19:52:39)
Copyright (c)
bitwise right shift is probably the fastest cast to int so far ... still in
many languages, intval is a function call
being a cast in both cases (int) is good as well ... bitwise, casting, works
with strings, arrays, boolean, whatever as well.
I don't think there is any difference in php,
Hi, We are looking to upgrade php 5.2.1 to 5.2.8. Do we need to rebuild the
libphp5.so also to detect the new version of underlying php or will the same
old version of libphp5.so build for php 5.2.1, automatically detect a new
underlying php installation? thanks
Newbie question.
I need to download a very large amount of xml data from a site using CURL.
How to bypass (pipe) curl_exec return value directly to a file, without
using memory allocation?
set_time_limit(0);
$ch = curl_init($siteURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$mixed =
On 12/10/2009 9:21 PM, David Otton wrote:
2009/10/11 Eric Baumanbaum...@livejournal.dk:
As before, please feel free to insult my code. ;-) Any and all feedback is
of course most appreciated.
I know you're more concerned with structure, but your checkInt()
method is arguably buggy/has an
28 matches
Mail list logo