From: Peter Lind
> On 25 June 2010 19:58, Bob McConnell wrote:
>> From: Daevid Vincent
>>
>>> Why do this "in_array()" business??
>>>
>>> Just do this...
>>>
>>> if (self::$aboveArray[$name])
>>> {
>>> //something interesting here
>>> }
>>
>> Does that gibberish actually do something? It doesn
On 25 June 2010 19:58, Bob McConnell wrote:
> From: Daevid Vincent
>
>> Why do this "in_array()" business??
>>
>> Just do this...
>>
>> if (self::$aboveArray[$name])
>> {
>> //something interesting here
>> }
>
> Does that gibberish actually do something? It doesn't make any sense to
> me, while
From: Daevid Vincent
> Why do this "in_array()" business??
>
> Just do this...
>
> if (self::$aboveArray[$name])
> {
>//something interesting here
> }
Does that gibberish actually do something? It doesn't make any sense to
me, while in_array() actually looks like what it does.
Bob McConne
> -Original Message-
> From: Gary . [mailto:php-gene...@garydjones.name]
> Sent: Friday, June 25, 2010 1:14 AM
> To: PHP
> Subject: Re: [PHP] in_array - what the...
>
> "Ford, Mike" writes:
> >> -Original Message-
> >>
> -Original Message-
> From: Gary . [mailto:php-gene...@garydjones.name]
> Sent: 25 June 2010 09:14
> To: PHP
> Subject: Re: [PHP] in_array - what the...
>
> "Ford, Mike" writes:
> >> -Original Message-
> >>
"Ford, Mike" writes:
>> -Original Message-
>> If I have an array that looks like
>> array(1) {
>> ["mac_address"]=>
>> string(2) "td"
>> }
>>
>> and I call
>> if (in_array($name, self::$aboveArray))
>> with $name as
>> string(11) "mac_address"
>>
>> what should be the result
> -Original Message-
> From: Gary . [mailto:php-gene...@garydjones.name]
> Sent: 25 June 2010 08:18
> To: PHP
> Subject: [PHP] in_array - what the...
>
> If I have an array that looks like
> array(1) {
> ["mac_address"]=>
> string(2)
If I have an array that looks like
array(1) {
["mac_address"]=>
string(2) "td"
}
and I call
if (in_array($name, self::$aboveArray))
with $name as
string(11) "mac_address"
what should be the result?
Because it is *false* and it is driving me nuts! This despite the fact
that if I d
On 22 Nov 2008, at 00:06, Ashley Sheridan wrote:
On Fri, 2008-11-21 at 09:11 +, Stut wrote:
On 20 Nov 2008, at 23:09, Ashley Sheridan wrote:
On Thu, 2008-11-20 at 09:25 +, Stut wrote:
On 20 Nov 2008, at 06:55, Yashesh Bhatia wrote:
I wanted to use in_array to verify the results of a fo
On Fri, 2008-11-21 at 09:11 +, Stut wrote:
> On 20 Nov 2008, at 23:09, Ashley Sheridan wrote:
> > On Thu, 2008-11-20 at 09:25 +, Stut wrote:
> >> On 20 Nov 2008, at 06:55, Yashesh Bhatia wrote:
> >>> I wanted to use in_array to verify the results of a form submission
> >>> for a checkbox an
On 20 Nov 2008, at 23:09, Ashley Sheridan wrote:
On Thu, 2008-11-20 at 09:25 +, Stut wrote:
On 20 Nov 2008, at 06:55, Yashesh Bhatia wrote:
I wanted to use in_array to verify the results of a form submission
for a checkbox and found an interesting
behaviour.
$ php -v
PHP 5.2.5 (cli) (built
2008/11/20 Stut <[EMAIL PROTECTED]>:
> On 20 Nov 2008, at 06:55, Yashesh Bhatia wrote:
>>
>> I wanted to use in_array to verify the results of a form submission
>> for a checkbox and found an interesting
>> behaviour.
>>
>> $ php -v
>> PHP 5.2.5 (cli) (built: Jan 12 2008 14:54:37)
>> $
>>
>> $ cat
On Thu, 2008-11-20 at 09:25 +, Stut wrote:
> On 20 Nov 2008, at 06:55, Yashesh Bhatia wrote:
> > I wanted to use in_array to verify the results of a form submission
> > for a checkbox and found an interesting
> > behaviour.
> >
> > $ php -v
> > PHP 5.2.5 (cli) (built: Jan 12 2008 14:54:37)
> >
On 20 Nov 2008, at 06:55, Yashesh Bhatia wrote:
I wanted to use in_array to verify the results of a form submission
for a checkbox and found an interesting
behaviour.
$ php -v
PHP 5.2.5 (cli) (built: Jan 12 2008 14:54:37)
$
$ cat in_array2.php
'page',
'story' =>
2008/11/19 Yashesh Bhatia <[EMAIL PROTECTED]>:
> Hi.
>
> I wanted to use in_array to verify the results of a form submission
> for a checkbox and found an interesting
> behaviour.
>
> $ php -v
> PHP 5.2.5 (cli) (built: Jan 12 2008 14:54:37)
> $
>
> $ cat in_array2.php
> $node_review_types = array
Hi.
I wanted to use in_array to verify the results of a form submission
for a checkbox and found an interesting
behaviour.
$ php -v
PHP 5.2.5 (cli) (built: Jan 12 2008 14:54:37)
$
$ cat in_array2.php
'page',
'story' => 'story',
'noder
Hi,
Thanks for your reply. After a sleep overnight I found I said
something really stupid. Arrays are compared in deep, and also for
objects. I really forgot the old PHP4 way and thought PHP5 compares
object simply by address when using ==, which is not the real case. I
need to use === for compar
Try like this:
var_dump(in_array($a, $test, true));
Richard Lynch wrote:
Try providing a custom comparison function.
Almost for sure, PHP is attempting to "test" the == by a deeper scan
than you think.
On Fri, November 3, 2006 10:56 am, tamcy wrote:
Hello all,
I'm new to this list. To not
Try providing a custom comparison function.
Almost for sure, PHP is attempting to "test" the == by a deeper scan
than you think.
On Fri, November 3, 2006 10:56 am, tamcy wrote:
> Hello all,
>
> I'm new to this list. To not flooding the bug tracking system I hope
> to clarify some of my understand
Hello all,
I'm new to this list. To not flooding the bug tracking system I hope
to clarify some of my understanding here.
I am referring to the (now bogus) bug report
http://bugs.php.net/bug.php?id=39356&edit=2. This happens after my
upgrade to PHP 5.2, where the code shown produces a "Fatal err
Hi all sory for the double post but i have deleted the first email that
i have send to the list.
The problem that i have found is that in_array function don't work with
annidate path.
I have created a function that update a list of filepath from a
directory to DB
but when i use particular path w
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 16, 2004 3:39 PM
Subject: Re: [PHP] in_array w/statement
> On Friday 17 December 2004 02:33, Sebastian wrote:
>
> > I cannot solve this problem,. sorry if this looks confusing,.
>
> It is ...
>
> > i have a form
> reason it seems to always be true, ... something i'm doing wrong? btw, i
> cannot add the in_array to the statement because if the $buddylist is empty
> it will generate errors because of the empty implode.
you could add the is_array() check.
> $buddylist = preg_split('/( )+/', trim($userinfo['
On Friday 17 December 2004 02:33, Sebastian wrote:
> I cannot solve this problem,. sorry if this looks confusing,.
It is ...
> i have a form and don't want to set the variable if the in_array is true..
> the code works, up until i add the last !$buddy in the statement, for some
> reason it seems
Hi,
I cannot solve this problem,. sorry if this looks confusing,.
i have a form and don't want to set the variable if the in_array is true..
the code works, up until i add the last !$buddy in the statement, for some
reason it seems to always be true, ... something i'm doing wrong? btw, i
cannot add
Ing. Ivo F.A.C. Fokkema wrote:
Hi guys and gals,
I'm not screaming "Bug! Bug!" but this _does_ look 'illogical' to me. I've
searched the archives, but found no earlier conversation. Sorry if
I missed it. Consider the following code:
var_dump(in_array('test', array(0)));
What does this return? I exp
Hi guys and gals,
I'm not screaming "Bug! Bug!" but this _does_ look 'illogical' to me. I've
searched the archives, but found no earlier conversation. Sorry if
I missed it. Consider the following code:
var_dump(in_array('test', array(0)));
What does this return? I expect bool(false), but it retu
Ben G. McCullough wrote:
I agree - my solution is VERY resource intensive, but I think I may have
over simplified my question.
Each item is listed by two categories, $medium and $period. Users can
get to the item via a 'browse' of either category. I want to user to be
able to get back to the
You solution is quite resource expensive. I would do:
[find $maxpages]
SELECT COUNT(*)/12 FROM table WHERE id <= $real_id;
list($maxpages) = fetch_row()
In result.php use "ORDER BY id"
Ben G. McCullough wrote:
I think I have a flaw of logic in trying to find the correct page in a
mutli-page sql
I think I have a flaw of logic in trying to find the correct page in
a mutli-page sql result.
Goal - find the correct page [results.php?page=x] when linking from
another page.
Current method - loop through a pagination function looking for the
matching $id in an array [simplified for illustrat
jochen schultz wrote:
> Hi Riccardo,
>
>
>
>> if(mysql_num_rows($rty->resu)) { //result
>> $rec = mysql_fetch_array($rty->resu);
>>if(!isset($_SESSION["bkmks"]) ||
>
>
> When you save something for the first time, the element of
> $_SESSI
Hi Riccardo,
>if(mysql_num_rows($rty->resu)) { //result
>$rec = mysql_fetch_array($rty->resu);
> if(!isset($_SESSION["bkmks"]) ||
When you save something for the first time, the element of $_SESSION["bkmks"] is a
string and you can compa
Hi every1 I got this script that works fine on my local windows pc but
on the remote server (FreeBSD)
I get this message:
Warning: Wrong datatype for first argument in call to in_array in
/usr/local/..
the script should bookmark an user choice storing it in the
$_SESSION["bkmks"] array.
t
Unless you are using PHP version 4.2 or higher, the first argument can't be
an array.
Kirk
> -Original Message-
> From: Jas [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 21, 2002 11:46 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] in_array problems (another pair
On Wednesday 22 May 2002 01:45, Jas wrote:
> I don't think I am using the syntax correctly, I have been looking at this
> function on php.net and everything I have seen says my code should be
> working.
What version of php are you using? In PHP versions before 4.2.0 needle was not
allowed to be
I don't think I am using the syntax correctly, I have been looking at this
function on php.net and everything I have seen says my code should be
working.
A form allows the user to upload a file:
Resulting file (upload_done.php):
And here is my error:
Warning: Wrong datatype for first arg
On Wed, 2002-02-06 at 08:26, John Fulton wrote:
>
> Does anyone know which algorithm in_array() uses?
>
> For example, if I say
>
> in_array("foo", $arr)
>
> Does in_array() do an unordered sequential serach of $arr for
> "foo" which takes up to n comparisons [where n = count($arr)],
> or d
Does anyone know which algorithm in_array() uses?
For example, if I say
in_array("foo", $arr)
Does in_array() do an unordered sequential serach of $arr for
"foo" which takes up to n comparisons [where n = count($arr)],
or does it do a binary search which takes about lg(n) comparisons?
Is
Steve Osborne" <[EMAIL PROTECTED]>; "PHP-General
> (E-mail)" <[EMAIL PROTECTED]>
> Sent: Thursday, November 29, 2001 11:29 AM
> Subject: RE: [PHP] in_array error
>
>
> > Steve,
> >
> > What version of PHP are you running. in_ar
ECTED]>
Sent: Thursday, November 29, 2001 11:29 AM
Subject: RE: [PHP] in_array error
> Steve,
>
> What version of PHP are you running. in_array is >= 4.0. is_array was in
3.0
> so this may be an issue for you.
>
> Gerard
>
> -Original Message-
> From: Steve
Steve,
What version of PHP are you running. in_array is >= 4.0. is_array was in 3.0
so this may be an issue for you.
Gerard
-Original Message-
From: Steve Osborne [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 29, 2001 3:08 PM
To: PHP-General (E-mail)
Subject: [PHP] in_array er
Can anyone explain why I am getting the following error?
Fatal error: Call to unsupported or undefined function in_array() in
includes/chinlib21stCentury.inc on line 3131
Code:
if( (is_array($List)) AND (is_array($RemoveList)) )
{
$ListItems = count($List);
sort($List);
for($ListItem=0;
On Thu, 13 Sep 2001 14:17:12 +0300, you wrote:
>i wrote php scripts with php 4. but my server's php version is php 3. i
>used in_array function while i was writing the scripts. i used that
>function to check posted variables is available or not.
>is there an another way to check this posted var
hi,
i wrote php scripts with php 4. but my server's php version is php 3. i
used in_array function while i was writing the scripts. i used that
function to check posted variables is available or not.
is there an another way to check this posted variables or another one
likes in_array function?
in_array is for testing that a value exists in an array. What you want is
if ( isset( $some_array[some_key] ) )
print "HAS KEY";
else
print "DOESN'T HAVE KEY";
At 14:23 31/07/2001 -0400, Jaxon wrote:
>hi,
>
>in_array is confusing me :)
>
>can someone show me an example of how to test if
hi,
in_array is confusing me :)
can someone show me an example of how to test if
$some_array[some_key]
actually has a value, without outputting the value?
tia,
jaxon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail
results on any server.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-Original Message-
From: Richard [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 6:23 AM
To: [EMAIL PROTECTED]
Subject: [PHP
Greetings..
This is how I currently check for instances of words and other:
for ($i=0; $i < $total_lines; $i++){
$line_array = explode("|",$line[$i]);
$swhat=strtolower($txtLinkname);
$xos =
array(strtolower($line_array[1]),strtolower($line_array[2]),strtolower($line
_
recusrion is your friend.
$val)
{
if (is_array($val))
{
if (in_multi_array($needle, $val))
return 1;
} else
if ($val == $needle)
return 1;
}
}
if (in_multi_array('d', $test))
echo "TRUE \n";
else
echo "FALSE \n";
?>
--
Chris Lee
Mediawaveonline.com
How can I check if a value is in a multidimensional array?
like I have
";
$produtos_sem_tracking[$i]['cod']=$idt[0];
$produtos_sem_tracking[$i]['idt']=$idt[1];
$produtos_sem_tracking[$i]['gen']=$idt[2];
}
?>
how can I check for an existing
50 matches
Mail list logo