uhm, you're getting only "C" because you are surrounding the varible with brackets [] ..
i don't think you fully understand the foreach loop.
i will give you a idea:
Correct way:
$array = array('word1', 'word2', 'word3');
foreach($array as $var)
{
echo $var. "<br />";
// output:
// word1
// word2
// word3
}
Incorrect way:
$array = array('word1', 'word2', 'word3');
foreach($array as $var)
{
echo $var[0]. "<br />";
// output:
// w
// w
// w
}
when you do a foreach on an array it splits up the array and assign them to the variable... so dont use [0] .. [1] ..etc.. its not an array anymore..
you can only use it on the explode since that variable is now an array:
$menu_list = explode("|", $menu_item);
then use
$menu_list[0]