* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]):
> I got the error again:
> http://bugs.php.net/search.php?search_for=&boolean=0&limit=10&order_by=&direction=ASC&cmd=display&status=All&bug_type%5B%5D=Scripting+Engine+problem&php_os=windows&phpver=&assign=&author_email=&bug_age=0
That reminds me o
I got the error again:
http://bugs.php.net/search.php?search_for=&boolean=0&limit=10&order_by=&direction=ASC&cmd=display&status=All&bug_type%5B%5D=Scripting+Engine+problem&php_os=windows&phpver=&assign=&author_email=&bug_age=0
Curt Zirzow wrote:
* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]):
T
On Thu, 2003-10-23 at 13:01, Marek Kilimajer wrote:
> This echoes out "Bad" on my LAMP server as it should, but "Good" on
> Cesar's windows server:
Aaaah how true. I wasn't following this much earlier so I don't know if
he is using the most up to date version, in which case it may already be
fixe
This echoes out "Bad" on my LAMP server as it should, but "Good" on
Cesar's windows server:
$value = "12.3";
$number = intval($value);
echo "Number: $number, Value: $value";
// echoes: Number: 12, Value: 12.3
if ($number != $value) {
echo "Bad";
} else {
echo "Good"; // echoes Good!!
On Thu, 2003-10-23 at 12:41, John W. Holmes wrote:
> Greg Beaver wrote:
>
> > http://www.php.net/is_numeric
> >
> > is the function you are looking for. No need for fancy regexps.
>
> The OP is looking for an integer, but is_numeric() will return true for
> float values and also for numbers in
On Thu, 2003-10-23 at 12:43, Marek Kilimajer wrote:
> These are all workarounds around the real problem. If php gets it wrong
> fix php.
Could you explain how PHP has it "wrong"?
Rob.
--
..
| InterJinn Application Framework - http://ww
On Thu, 2003-10-23 at 12:28, Greg Beaver wrote:
> Hello all,
>
> http://www.php.net/is_numeric
>
> is the function you are looking for. No need for fancy regexps.
Sorry, that doesn't cut it. He want's integers not floats, and I'm also
sure he doesn't want exponential notation to pass either.
C
These are all workarounds around the real problem. If php gets it wrong
fix php.
Robert Sedlacek wrote:
On Thu, 23 Oct 2003 11:59:44 -0400, Cesar Cordovez wrote:
So, how can I check if what ever the user writes is an integer or not,
knowing that he will write it in a string field.
Idea:
if(
Greg Beaver wrote:
http://www.php.net/is_numeric
is the function you are looking for. No need for fancy regexps.
The OP is looking for an integer, but is_numeric() will return true for
float values and also for numbers in scientific notation. So "12.3" and
"12E3" will be TRUE.
The original $n
Cesar,
You can take a look into is_numeric () (http://www.php.net/is_numeric).
It will tell you whether the value is a number or a numeric string, but
it will also return true if the value is a float. However, at that point
you know your working with the right type of variable.
Jordan S. Jone
Status: All
Return only bugs in categories: Scripting Engine Problem
Return bugs with operating system: windows
But it is ok now.
Curt Zirzow wrote:
* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]):
This should be reported as a bug.
I tried few searches and I got
Warning: mysql_fetch_array():
Hello all,
http://www.php.net/is_numeric
is the function you are looking for. No need for fancy regexps.
Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org
Cesar Cordovez wrote:
Sorry, typo, this is what I meant,
!is_integer("12thisisnotanumber") retuns true.
but also,
is_integer("12") ret
* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]):
> This should be reported as a bug.
>
> I tried few searches and I got
>
> Warning: mysql_fetch_array(): 9 is not a valid MySQL result resource in
> /local/Web/sites/php-bugs-web/search.php on line 182
The search seems to work now, what did you
Sorry, typo, this is what I meant,
!is_integer("12thisisnotanumber") retuns true.
but also,
is_integer("12") return false.
therefore,
is_integer(12) return true.
So, how can I check if what ever the user writes is an integer or not,
knowing that he will write it in a string field.
Any how,
On Thu, 2003-10-23 at 11:51, Robert Cummings wrote:
> On Thu, 2003-10-23 at 11:21, Cesar Cordovez wrote:
> >
> > At this point, I think I have to change the procedure. This is not
> > good. Any sugestions on how to now if the user types an integer number
> > in a field?
> >
>
> Here's a real
On Thu, 2003-10-23 at 11:21, Cesar Cordovez wrote:
>
> At this point, I think I have to change the procedure. This is not
> good. Any sugestions on how to now if the user types an integer number
> in a field?
>
Here's a really simple way:
if( ereg( '^[[:space:]]*[[:digit:]]+[[:space:]]*', $
On Thu, 2003-10-23 at 11:41, Cesar Cordovez wrote:
> Because is_integer("12thisisnotanumber") retuns true.
>
Not for me it doesn't. Returns false. Prolly because it's a string. Even
the following returns false for me:
is_integer("12")
Cheers,
Rob.
--
.--
Because is_integer("12thisisnotanumber") retuns true.
Andrea Pinnisi wrote:
why don't you use this??
http://it.php.net/manual/it/function.is-integer.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
This should be reported as a bug.
I tried few searches and I got
Warning: mysql_fetch_array(): 9 is not a valid MySQL result resource in
/local/Web/sites/php-bugs-web/search.php on line 182
on bugs.php.net
Cesar Cordovez wrote:
This is getting weird by the minute. I changed the script:
if (
why don't you use this??
http://it.php.net/manual/it/function.is-integer.php
Cesar Cordovez ha scritto:
This is getting weird by the minute. I changed the script:
if ($number != $value) {
echo "Bad";
} else {
echo "Good"; // echoes Good!!
}
to:
($number != $value)
($number !== $v
This is getting weird by the minute. I changed the script:
if ($number != $value) {
echo "Bad";
} else {
echo "Good"; // echoes Good!!
}
to:
($number != $value)
($number !== $value)
($number === $value)
and I get the Good stuff...
At this point, I think I have to change the
The other purpose of this procedure is if the user types "12asdasd" into
$value, $number will be assigned "12" so $value and $number are not the
same, meaning $value is not a number. Which is correct, but the
procedure is not working correctly in PHP when it should. (It works in
c, c++, fortr
* Thus wrote Cesar Cordovez ([EMAIL PROTECTED]):
> Curt:
>
> My fault! You are right, but thats not what I want. $value comes from a
> form filled by a user. I want $value to be an integer. Not a float.
> So if the user types "12.3" the system has to send an error msg.
Yeah, after reading me
Curt:
My fault! You are right, but thats not what I want. $value comes from a
form filled by a user. I want $value to be an integer. Not a float.
So if the user types "12.3" the system has to send an error msg.
Therefore the procedure.
By-the-way, Im using PHP 4.3.3 (on windows XP profesion
What versio of php? I get Bad (which is good ;)
Cesar Cordovez wrote:
Can somebody explain me why is this happening?
$value = "12.3";
$number = intval($value);
echo "Number: $number, Value: $value";
// echoes: Number: 12, Value: 12.3
if ($number != $value) {
echo "Bad";
} else {
echo "Go
* Thus wrote Cesar Cordovez ([EMAIL PROTECTED]):
> Can somebody explain me why is this happening?
>
> $value = "12.3";
> $number = intval($value);
>
> echo "Number: $number, Value: $value";
> // echoes: Number: 12, Value: 12.3
I'm guessing you wondering why the .3 is removed. Thats because
12.3
Can somebody explain me why is this happening?
$value = "12.3";
$number = intval($value);
echo "Number: $number, Value: $value";
// echoes: Number: 12, Value: 12.3
if ($number != $value) {
echo "Bad";
} else {
echo "Good"; // echoes Good!!
}
The previous should be echoing "Bad
27 matches
Mail list logo