Phparray usage, instance tutorial-PHP source code

Source: Internet
Author: User
Ec (2); & lt ;? Php * & nbsp; background management framework configuration & nbsp; author: xqbar & nbsp; datetime: 2008-3-29 * $ toplinkarray (0 & gt; account management, news management, shop management, system Management, links); $ leftnavarray (& nbsp; script ec (2); script


/*
Background Management Framework Configuration
Author: xqbar
Datetime: 2008-3-29
*/
$ Toplink = array (0 => 'account management', 'news management', 'shop management', 'System management', 'friendship link ');
$ Leftnav = array (
0 => 'account management | exit system ',
'News management | news classification | exit the system ',
'Shop management | shop classification | template management | exit the system ',
'Category management | region management | template management | exit system ',
'Link | exit the System'
);
$ Leftlink = array (
0 => 'postmaster Shop member | exit management ',
'Add news to all news @ generate file | news classification | exit management ',
'Add a store to all stores | store category | Add a template to the template list | exit management ',
'News classification shop category | region management | template List add template | exit management ',
'Add connection in the connection list | exit Management'
);
Function topnav ()
{
Global $ toplink;
$ Itemnum = count ($ toplink );
Echo'

';
Echo'

';
Echo'

';
Echo'

    ';
    Foreach ($ toplink as $ key => $ value) {echo"
  • $ Value
  • ";}
    Echo'
';
Echo'

';
Echo'

';
Echo'

';
}
Function leftnav ($ itemid)
{
Global $ leftnav, $ leftlink;
$ Navtitle = explode ('|', $ leftnav [$ itemid]);
$ Navlink = explode ('|', $ leftlink [$ itemid]);
Echo"

";
Foreach ($ navtitle as $ key => $ value)
{
Echo"

";
Echo "{$ value }";
Echo"

    ";
    If (strlen (strstr ($ navlink [$ key], "@")> 0 ){
    $ Itemlink = explode ('@', $ navlink [$ key]);
    Foreach ($ itemlink as $ link) {echo"
  • {$ Link}
  • ";}
    } Else {echo"
  • $ Navlink [$ key]
  • ";}
    Echo"
";
Echo"

";
}
Echo"

";
}
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.