Php advanced implementation of unlimited classification 3_PHP tutorial

Source: Internet
Author: User
Php advanced implementation of unlimited Classification 3. 3. program Control -------------------------------------------------------------- This step is the most complex and hard. First, let's take a look at step 3 that needs to be completed by the program. program Control ------------------------------------------------------------ This step is the most complicated and difficult to implement. First, let's take a look at the steps required by the program: 1) create a category Upload; 2) create information Upload) clearly show the relationship between each category; 4) query processing; 5) How to handle the editing and deletion functions; the fifth step is the most difficult, this is because the editing and deletion of a category involve the unique nature. next I will describe php program control one by one: 1) before introducing this function, I will first introduce the explode () function, which is a string processing function, used to break down the string. for example, to break down the number $ val in "0: 1: 2: 3: 4" = 0: 1: 2: 3: 4; $ rid = explode (":", $ val); after processing by the explode () function, all the numbers in $ val are decomposed into the $ rid array, print echo $ rid [0], $ rid [1], $ rid [2]... "; that's all. the explode () function plays an important role in the entire classification process. now we will introduce program control for non-existing classification. assume that a total Category is 0, and all categories are its descendant categories. now we will create the first classification system to see its storage format in the database: id | uid | type | rout_id | rout_char 1 | 0 | system | the system is further divided into Linux: id | uid | type | rout_id | rout_char 2 | 1 | Linux | system: Linux or above is the form of database storage. now you can complete php code, this is very similar to the code of the Forum. All we need to do is put the classification id into the uid, and the uid of the parent category is put 0. let's look at the code below:

This step is the most complex and hard to implement the function of unlimited classification. first look at the steps that need to be completed by the program...

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.