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
array search part 2 [message #183752] Mon, 18 November 2013 14:10 Go to previous message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma:
Senior Member
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?

<?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++;
}


?>

Result example.
468The Happy Heart Of Paris
468468468468468468468468468468468468468............
[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 15:42:43 GMT 2024

Total time taken to generate the page: 0.03623 seconds