<?php

$data_array = [
  ['name' => 'Lagos', 'population' => 21.0],
  ['name' => 'Cairo', 'population' => 15.2],
  ['name' => 'Kinshasa-Brazzaville', 'population' => 11.3],
  ['name' => 'Greater Johannesburg', 'population' => 7.55],
  ['name' => 'Mogadishu', 'population' => 5.85],
  ['name' => 'Khartoum-Omdurman', 'population' => 4.98],
  ['name' => 'Dar Es Salaam', 'population' => 4.7],
  ['name' => 'Alexandria', 'population' => 4.58],
  ['name' => 'Abidjan', 'population' => 4.4],
  ['name' => 'Casablanca', 'population' => 3.98],
]; 
$found=0;
$search_name = 'Dar Es Salaam';
echo $search_name\;

$index = array_search($search_name, array_column($data_array, 'name'));
$population = $data_array[$index]['population'];
echo ;

$search_val = 5;
echo ;
foreach ($data_array as $index => $row) {
  if ($row['population'] < $search_val) {
    $name = $row['name'];
    echo ;
    break;
  }
}

$search_term = 'A';
echo $search_term\;
foreach ($data_array as $index => $row) {
  if (strpos($row['name'], $search_term) === 0) {
    echo ;
    break;
  }
}

echo ;

Output:
Find the (zero-based) index of the first city in the list whose name is  - 6
Answer 1: Index: [6] Population for Dar Es Salaam is 4.7 Million

Find the name of the first city in this list whose population is less than 5 million - Khartoum-Omdurman
Answer 2: Index [5] Population for Khartoum-Omdurman is 4.98 Million

Find the population of the first city in this list whose name starts with the letter  - 4.58
Answer 3: Index: [7] Population for Alexandria is 4.58 Million

Done...