I have a script that works and loops showing various results, but i want to chek if result match a given variable. It works it i enter it like '4' but wont if entered as a $myArray?
The code is
$vehicle_req = "4";
echo "Vehicle required is : ".$v[$vehicle_req]."<BR><BR>";
//----- GET COMPANIES IN AREA --------
echo "Companies in the area :<BR><BR>";
$result = mysqli_query($con,"SELECT *, ( 3959 * acos( cos( radians(53.83428999999999) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(-3.0399797000000035) ) + sin( radians(53.83428999999999) ) * sin( radians( latitude ) ) ) ) AS distance FROM clients HAVING distance < 30 ORDER BY distance LIMIT 0 , 20;");
while($row = mysqli_fetch_array($result)) {
$name = $row['name'];
$id = $row['id'];
$vehicles = $row['vehicles'];
echo "<B>".$id." -</B> ".$name."<BR>".$vehicles."<BR>";
$myArray = explode(':', $vehicles);
foreach($myArray as $my_Array){
echo "<BR>".$v[$my_Array]."<BR>";
echo $my_Array."<BR>";
if($my_Array == '4')
echo "MATCH vehicle 4<BR>";
}
}