On Sat, Nov 29, 2008 at 5:59 PM, Martin Zvarík [EMAIL PROTECTED] wrote:
Joe napsal(a):
Is it possible to use a PHP operator as a callback? Suppose I want to add
two
arrays elementwise, I want to be able to do something like this:
array_map('+', $array1, $array2)
but this doesn't work as +
Joe napsal(a):
Is it possible to use a PHP operator as a callback? Suppose I want to add two
arrays elementwise, I want to be able to do something like this:
array_map('+', $array1, $array2)
but this doesn't work as + is an operator and not a function.
I can use the BC library's math functions
On Tue, July 4, 2006 7:35 am, Mathijs wrote:
//Do if VALIDATE_CHECK1 is set BUT NOT when VALIDATE_CHECK3 is set.
if ($flag2 self::VALIDATE_CHECK1 $flag2 ~self::VALIDATE_CHECK3)
Did you check operator precedence for versus ?
Perhaps you just need parentheses...
I'm also not at all sure the
Hello there.
I am working with some bitwise Operators for validating some variables.
Now i need to know if an certain bit is NOT set and an other bit IS set.
Example.
?php
const VALIDATE_CHECK1 = 1;
const VALIDATE_CHECK2 = 2;
const VALIDATE_CHECK3 = 4;
const VALIDATE_ALL= 7;
//--Example
Mathijs wrote:
Hello there.
I am working with some bitwise Operators for validating some variables.
Now i need to know if an certain bit is NOT set and an other bit IS set.
Example.
?php
const VALIDATE_CHECK1 = 1;
const VALIDATE_CHECK2 = 2;
const VALIDATE_CHECK3 = 4;
const
Jochem Maas wrote:
Mathijs wrote:
Hello there.
I am working with some bitwise Operators for validating some variables.
Now i need to know if an certain bit is NOT set and an other bit IS set.
Example.
?php
const VALIDATE_CHECK1 = 1;
const VALIDATE_CHECK2 = 2;
const VALIDATE_CHECK3 = 4;
Mathijs wrote:
Jochem Maas wrote:
Mathijs wrote:
...
Thank you very much.
This seems to work :).
cool. heres's a couple of funcs that might help you to understand bitwise
operations better:
?php
/* whether there is only 1 single bit set or not */
function single_bit_set(/*int*/ $i)
Jochem Maas wrote:
Mathijs wrote:
Jochem Maas wrote:
Mathijs wrote:
...
Thank you very much.
This seems to work :).
cool. heres's a couple of funcs that might help you to understand bitwise
operations better:
?php
/* whether there is only 1 single bit set or not */
function
Jochem Maas wrote:
Mathijs wrote:
Jochem Maas wrote:
Mathijs wrote:
...
Thank you very much.
This seems to work :).
cool. heres's a couple of funcs that might help you to understand bitwise
operations better:
?php
/* whether there is only 1 single bit set or not */
function
Jochem Maas wrote:
Mathijs wrote:
Jochem Maas wrote:
Mathijs wrote:
...
Thank you very much.
This seems to work :).
cool. heres's a couple of funcs that might help you to understand bitwise
operations better:
?php
/* whether there is only 1 single bit set or not */
function
Jochem Maas wrote:
Mathijs wrote:
Jochem Maas wrote:
Mathijs wrote:
...
Thank you very much.
This seems to work :).
cool. heres's a couple of funcs that might help you to understand bitwise
operations better:
?php
/* whether there is only 1 single bit set or not */
function
sorry - I have had a php5 CLI at hand for so long
I forgot that 'php -r' is not available in v4.
that said the 'php -a' option also works (although
I always find the interactive mode odd to work with)
Kevin Kinsey wrote:
Carl Furst wrote:
Well, I tried something simple...
$ php -r 'echo
Hey all,
Question about ternary operators. You can't really use functions INSIDE
ternary operators, right? They can only be tokens and operators?
So
$fabulous = true;
$fabulous ? echo I am fabulous!\n : echo I am a looser!\n;
Would not work?
And this:
echo $fabulous ? I am fabulous!\n :
Carl Furst wrote:
Hey all,
Question about ternary operators. You can't really use functions INSIDE
ternary operators, right? They can only be tokens and operators?
So
$fabulous = true;
$fabulous ? echo I am fabulous!\n : echo I am a looser!\n;
Would not work?
testing this is quite
, thanks for your help, I was playing around with it and wanted to see
what other cool stuff you could do.
Carl Furst
-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 15, 2006 3:55 PM
To: Carl Furst
Cc: php-general@lists.php.net
Subject: Re: [PHP
Carl Furst wrote:
Well, I tried something simple...
$ php -r 'echo hello world\n;'
Error in argument 1, char 2: option not found r
Error in argument 1, char 2: option not found r
Usage: php [-q] [-h] [-s] [-v] [-i] [-f file]
php file [args...]
-a Run interactively
-C
please read
http://www.php.net/manual/en/language.oop.php
explaining what Objects are exactly (since it's looping over an object
property which just so happens to be an array)
http://www.php.net/manual/en/control-structures.foreach.php
explains what = is (part of foreach())
- tul
Henry
Hello,
From php manual:
$a $b Shift leftShift the bits of $a $b steps to the left (each step
means multiply by two)
$a $b Shift rightShift the bits of $a $b steps to the right (each step
means divide by two)
So i ask what this output?
$a = 4;
$b = 3;
echo $a $b;
echo $a $b;
Angelo
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
on Monday, September 26, 2005 9:18 AM said:
So i ask what this output?
$a = 4;
$b = 3;
echo $a $b;
echo $a $b;
You just spent 3-5 minutes writing an email and now almost 10 minutes
waiting for a reply to something that would have taken
On 9/26/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
From php manual:
$a $b Shift leftShift the bits of $a $b steps to the left (each step
means multiply by two)
$a $b Shift rightShift the bits of $a $b steps to the right (each step
means divide by two)
So i ask what this output?
$a
[EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Monday, September 26, 2005 1:28 PM
Subject: RE: [PHP] Bitwise operators
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
on Monday, September 26, 2005 9:18 AM said:
So i ask what this output?
$a = 4;
$b = 3;
echo $a $b;
echo $a $b
I tested; I don't want to waste peoples time. Rewriting the question:
this outputs:
c = 32
d = 0
The question is why?
First row is the bit's number and the second row is the bit's value:
#8 | #7 | #6 | #5 | #4 | #3 | #2 | #1
---
128 | 64 | 32 | 16 | 8 |
The second value is the number of spaces to shift, dint realize that.
Thanks for your time Chris.
Angelo
- Original Message -
From: Chris Boget [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; php-general@lists.php.net
Sent: Monday, September 26, 2005 2:02 PM
Subject: Re: [PHP] Bitwise
* Thus wrote Jason Wong ([EMAIL PROTECTED]):
On Saturday 20 September 2003 10:57, John W. Holmes wrote:
[snip]
From my experience, it will work that way. I don't know if it's that
way for every version or not, though.
manual Migrating from PHP/FI 2 to PHP 3
heh... i havn't seen a
I am learning perl and my book describes boolean short circuiting.
Basically:
function1() OR function2();
(function2 never is evaluated if function1 is true).
Will this work in PHP for any function?
Thanks in advance,
-Dan
--
PHP General Mailing List (http://www.php.net/)
To
Dan Anderson wrote:
I am learning perl and my book describes boolean short circuiting.
Basically:
function1() OR function2();
(function2 never is evaluated if function1 is true).
Will this work in PHP for any function?
Yes.
From my experience, it will work that way. I don't know if it's
On Saturday 20 September 2003 10:57, John W. Holmes wrote:
[snip]
From my experience, it will work that way. I don't know if it's that
way for every version or not, though.
manual Migrating from PHP/FI 2 to PHP 3
--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software
Are the and operators identical in semantics to those
operators in C? In particular, do they handle sign extension in
the same manner?
--
JR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Gerard Samuel) wrote:
If != is the opposite of ==
What is the opposite of === ??
!($something===$somethingelse)
--
CC
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
Hello,
Is it possible to put variable operators in queries?
I tried this (the real variable comes from a form)
$Date_Operator =(=);
sql=SELECT * FROM poeple WHERE age $Date_operator 20;
$result_id = mysql_query($sql);
It doesn't work like this. I also tried:
sql=SELECT * FROM poeple WHERE
On Monday 21 May 2001 08:03, Heidi Belal wrote:
I have a form where i let people choose a file to
upload, but i want to limit them to image files only.
So i want to only allow the .gif and .jpg to be
uploaded. What i tried doing was this:
if ($filename_type == image/gif)
-- upload file
Hi All!
i'm creating this form for people to upload pictures,
so i want to be able to compare the type of the file,
so that if it's not a .gif or a .jpg i give them an
error message!
What i am using is:
If ($userfile_type == image/gif)
- here it uploads the file
otherwise it sends out an
Hi All!
i'm creating this form for people to upload pictures,
so i want to be able to compare the type of the file,
so that if it's not a .gif or a .jpg i give them an
error message!
What i am using is:
If ($userfile_type == image/gif)
- here it uploads the file
otherwise it sends out an
Hi All!
i'm creating this form for people to upload pictures,
so i want to be able to compare the type of the file,
so that if it's not a .gif or a .jpg i give them an
error message!
What i am using is:
If ($userfile_type == image/gif)
- here it uploads the file
otherwise it sends out an
Hi:
For compare strings you can use strcmp.
$st1 = hi;
$st2 = bye;
if (strcmp($st1, $st2)) {
echo are different;
}
else {
echo are equal;
}
The strcmp return 0 when the strings are equal. If the strings are diferent,
return the pos of the char where begin the diference.
I
Hi All,
I have a form where i let people choose a file to
upload, but i want to limit them to image files only.
So i want to only allow the .gif and .jpg to be
uploaded. What i tried doing was this:
if ($filename_type == image/gif)
-- upload file
otherwise give an error message!
but for
36 matches
Mail list logo