PHP array Usage, example tutorial

Source: Internet
Author: User
Tags explode

<?php
/*
Background Management Framework Configuration
Author:xqbar
datetime:2008-3-29
*/
$toplink =array (0=> ' account Management ', ' News management ', ' Store Management ', ' System Management ', ' friendship link ');
$leftnav =array (
0=> ' Account Management | Exit System ',
' News Management | News Classification | exit system ',
' Store Management | Shop Category | Template Management | exit System ',
' Classified Management | ' management of the domain | template management | exit System '
' Friendship link | Exit System '
);
$leftlink =array (
0=> ' <a href= "test/test.php" target= "MainFrame" > Administrator </a>&nbsp;<a href= "test/test.php" MainFrame "> Store member </a>|<a href=" Checklogin.php?logout=ok "target=" _top "> Exit Management </a>",
"<a href=" test/test.php "target=" MainFrame "> All news </a>&nbsp;<a href=" test/test.php "target=" MainFrame > Add News </a>@<a href= "test/test.php" target= "MainFrame" > Generate Files </a>|<a href= "test/" test.php "target=" mainFrame "> Information classification </a>|<a href=" checklogin.php "target=" _top "> Exit Management </a>",
"<a href=" test/test.php "target=" MainFrame "> All Shops </a>&nbsp;<a href=" test/test.php "target=" MainFrame "> Add shop </a>|<a href=" class/test.php "target=" MainFrame "> Shop classification </a>|<a href=" test/ test.php "target=" mainFrame > Template list </a>&nbsp;<a href= "class/mbadd.php" target= "mainFrame" > Adding templates </a>|<a href= "Checklogin.php?logout=ok" target= "_top" > Exit Management </a> ',
"<a href=" test/test.php "target=" MainFrame "> News classification </a>&nbsp;<a href=" test/test.php "target=" MainFrame "> Store classification </a>|<a href=" test/test.php "target=" mainFrame "> Regional administration </a>|<a href=" test/ test.php "target=" mainFrame > Template list </a>&nbsp;<a href= "test/test.php" target= "mainFrame" > Adding Templates < /a>|<a href= "Checklogin.php?logout=ok" target= "_top" > Exit Management </a> ',
' <a href= ' test/test.php ' target= ' mainFrame ' > Connection list </a>&nbsp;<a href= ' test/test.php ' target= ' MainFrame "> Add Connection </a>|<a href=" Checklogin.php?logout=ok "target=" _top "> Exit Management </a>"
);
function Topnav ()
{
Global $toplink;
$itemnum =count ($toplink);
Echo ' <div id= ' admin_header ' > ';
Echo ' <div id= ' Admin_logo ' ></div> ';
Echo ' <div id= ' admin_nav ' > ';
Echo ' <ul> ';
foreach ($toplink as $key => $value) {echo "<li id= ' navli{$key} ' ><a href= ' Javascript:navbar ({$key},{$ Itemnum}); ' > $value </a></li> ";}
Echo ' </ul> ';
Echo ' </div> ';
Echo ' </div> ';
Echo ' </div> ';
}
function LeftNav ($itemid)
{
Global $leftnav, $leftlink;
$navtitle =explode (' | ', $leftnav [$itemid]);
$navlink =explode (' | ', $leftlink [$itemid]);
echo "<div id= ' admin_left ' >";
foreach ($navtitle as $key => $value)
{
echo "<div class= ' navlist ' >";
echo "

echo "<ul id= ' navlist{$key} ' >";
if (strlen (Strstr ($navlink [$key], @)) >0) {
$itemlink =explode (' @ ', $navlink [$key]);
foreach ($itemlink as $link) {echo "<li>{$link}</li>";}
}else{echo "<li> $navlink [$key]</li>";}
echo "</ul>";
echo "</div>";
}
echo "</div>";
}
if (Isset ($_get[' cpp ')) {
LeftNav ($_get[' CPP '));
}
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.