如何在PHP中将<br>转换为(un)有序列表?

I have an array which is coming from db. Array has strings which is delimited by <br>. So I want to explode them and convert it to a

<ul>
    <li>...</li>
</ul> 

structure using a function (listIt($list)):

function listIt($list)
{
  $list = mb_convert_case($list, MB_CASE_TITLE, 'UTF-8');
  $text = explode('<br>', $list);
  $menu = '<ul>';

  foreach ($text as $li)
  {
    $menu .= '<li>' .   $li . '</li>';
  }

  return $menu . '</ul>';
}

My Array (rawMenu) is the following:

 array (size=5)
  0 => string 'Banana<br>Cheese<br>Egg<br>Salad<br>Water<br>Juice<br>Coffee' (length=62)
  1 => string 'Soup<br>Potato<br>Chicken<br>Fish<br>Juice<br>Wine<br>Salad' (length=61)
  2 => string 'Banana<br>Cheese<br>Egg<br>Salad<br>Water<br>Juice<br>Coffee' (length=62)
  3 => string 'Soup<br>Potato<br>Chicken<br>Fish<br>Juice<br>Wine<br>Salad' (length=61)
  4 => string 'Banana<br>Cheese<br>Egg<br>Salad<br>Water<br>Juice<br>Coffee' (length=62)

The problem is string which I pass to listIt($rawMenu[4]) function returns:

<ul>
   <li>Banana<br>Cheese<br>Egg<br>Salad<br>Water<br>Juice<br>Coffee</li>
</ul>

This happens because MB_CASE_TITLE converts the first letter to upper case (<Br>), then you have to split on Br:

$st = 'Banana<br>Cheese<br>Egg<br>Salad<br>Water<br>Juice<br>Coffee';
$list = mb_convert_case($st, MB_CASE_TITLE, 'UTF-8');
$text = explode('<Br>', $list);

$menu = '<ul>';
foreach ($text as $li){
  $menu .= '<li>' .   $li . '</li>';
}
$menu .= '</ul>';

print_r($menu);

Outputs:

<ul><li>Banana</li><li>Cheese</li><li>Egg</li><li>Salad</li><li>Water</li><li>Juice</li><li>Coffee</li></ul>

Working example in sandbox here.

As noted in the comments by @LightnessRacesinOrbit good practice would be to swap explode and conversion:

$st = 'Banana<br>Cheese<br>Egg<br>Salad<br>Water<br>Juice<br>Coffee';
$text = explode('<br>', $st);

$menu = '<ul>';
foreach ($text as $li){
  $menu .= '<li>' .   $li . '</li>';
}
$menu .= '</ul>';
$menu = mb_convert_case($menu, MB_CASE_TITLE, 'UTF-8');

print_r($menu);