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: solved [message #183796 is a reply to message #183791] Tue, 19 November 2013 19:41 Go to previous messageGo to previous message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma:
Senior Member
On Tue, 19 Nov 2013 17:43:25 +0100, Arno Welzel wrote:

> Am 19.11.2013 03:45, schrieb richard:
>> <?php
>>
>> $track=$_GET['item'];
>>
>>
>> $asong=$six0[$track][0];
>> $flip=$six0[$track][1];
>>
>> $max=count($six0);
>>
>> $match=0;
>>
>> for ($item=0;$item<=$max;$item++){
>> if ($flip==$six0[$item]['0'])
>> {if ($six0[$item][2]=$six0[$track][2])
>> {$match=$item;}}
>> }
>
> PLEASE format your code properly!
>
> for($item=0; $item <= $max; $item++)
> {
> if($flip == $six0[$item]['0'])
> {
> if($six0[$item][2] = $six0[$track][2])
> {
> $match = $item;
> }
> }
> }
>
> And why this?
>
> if($six0[$item][2] = $six0[$track][2])
>
> Please note: "=" is NOT the same as "=="!
>
> If you want to COMPARE $six0[$item][2] and $six0[$track][2] you MUST write:
>
> if($six0[$item][2] == $six0[$track][2])

The script works if it were on one line or 100 lines.

You've never seen a page where the source code was 10,000 characters long
all on one single line?
[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: Sun Nov 24 11:24:13 GMT 2024

Total time taken to generate the page: 0.06805 seconds