So this is array i’m working with
Array ( [0] => Traditional Favourites [1] => Starters [2] => Mains )
looping through this using the following:
[code]
$val = $resultsCatTitle[‘CategoryTitle’];
$resultArrMainCatgTitle[] = $val;
reset($resultArrMainCatgTitle);
while (list($key, $val) = each($resultArrMainCatgTitle)) {
if($val === “Traditional Favourites”) {
echo $val;
}
there is only one instance of the value “Traditional Favourites” in the array but using echo $val puts out the following:
Traditional FavouritesTraditional FavouritesTraditional Favourites
I’ve also tried a for loop that too provides the same result. Is there a reason behind is? and how would I go about correcting this? It should only come back with 1 instance shouldn’t it?
__(replaced single back-ticks with `[code]…[/code]