Answer the question
In order to leave comments, you need to log in
Encoding data from an array, what's wrong?
In general. There is a root index.php file into which the menu is loaded using such an array
$menu = [
["link"=>"Главная", "href"=>"index.php"],
["link"=>"О себе", "href"=>"about_me.php"],
["link"=>"Путешествия", "href"=>"travel.php"],
["link"=>"Мои песни", "href"=>"my_music.php"],
["link"=>"Видеозаписи", "href"=>"my_video.php"],
];
function drawMenu($menu, $poz = true){
global $menu;
if(!is_array($menu)){
return false;
}
$sort_by = " ";
if($poz == false){
$sort_by = "style ='display: block';";
}
echo "<ul>";
foreach($menu as $item){
echo "<li $sort_by>";
echo "<a href={$item['href']}>{$item['link']}</a>";
echo "</li>";
}
echo "</ul>";
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question