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 #183773 is a reply to message #183761] Mon, 18 November 2013 18:10 Go to previous messageGo to previous message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma:
Senior Member
On 18/11/13 17:11, richard wrote:
> <?php
>
> $track=$_GET['item'];
> echo $track;
>
> $asong=$six0[$track][0];
> $flip=$six0[$track][1];
> echo $flip;
> echo "<br>";
>
> $max=count($six0);
> echo $max;
> echo "<br>";
>
> for ($item=0;$item<=$max;$item++)
> {if ($flip==$six0[$item][0]){echo $six0[$item][0]."</br>";}}
>
> ?>
>
> This method works, but stops searching when a match has been found.
> Is there a way to continue the search when a match has been found?
> There are times when songs are liste 2 or more times and with different
> artists. So I need to find them all and then recover the one that matches
> to the original track.
>

It dosen't stop after finding one match, you have only one match.
Please indent your code better, makes it easier to read and a lot easier
for you to spot errors.

--

//Aho
[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: Fri Nov 22 03:46:18 GMT 2024

Total time taken to generate the page: 0.04686 seconds