FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » array search part 2
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: array search part 2 [message #183760 is a reply to message #183757] Mon, 18 November 2013 16:06 Go to previous messageGo to previous message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma:
Senior Member
On Mon, 18 Nov 2013 15:05:52 +0000, Tim Streater wrote:

> In article <93xuovoqvo59(dot)1wcgm8i5gn2hb$(dot)dlg(at)40tude(dot)net>, richard
> <noreply(at)example(dot)com> wrote:
>
>> I am attempting to search the array for matching entries.
>> All matches, not just the first.
>> While the code works fine, the result is not what I want.
>> $btrack should return the value of six0[$track][0].
>> Instead, the result shows the array key number.
>> Even if I change the [0] to [1].
>> Why?
>
> For the 17 billionth time, you thick dope, you have used = instead of ==
>
>> <?php
>>
>> $track=$_GET['item'];
>> echo $track;
>>
>> $flip=$six0[$track][1];
>> echo $flip;
>> echo "<br>";
>>
>> $max=count($six0);
>>
>> $arow=0;
>>
>> while ($max>$arow){
>>
>> $btrack=$six0[$arow][0];
>> if ($btrack=$track){echo $btrack;}
>> $arow++;
>> }
>>
>>
>> ?>

You thicker DOPE! IT MAKES NO FRICKIN DIFFERENCE!
And the examples I have seen at php.net all use a single =.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: searching an array
Next Topic: Perform maths based on a number in a text file
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 21 20:16:52 GMT 2024

Total time taken to generate the page: 0.04681 seconds