Why is it so difficult to understand a complex function?-php Tutorial

Source: Internet
Author: User
Why is it so difficult to understand a complex function? in this post, we finally edited getWebList (array (web_show & gt; 1, web_page & gt; & nbsp; array (like, $ web_page. %); ------------ it is so difficult to understand a complex function.

This post was last edited by tp_2015_6 at 09:09:38 on

GetWebList (array ('web _ show '=> 1, 'Web _ page' => array ('like', $ web_page.' % ')));

------------- Beautiful split line -----------------

/**
* Read record list
*
* @ Param
* @ Return array returned results in array format
*/
Public function getWebList ($ condition = array ('web _ page' => 'index'), $ page = ''){
$ Result = $ this-> table ('web')-> where ($ condition)-> order ('web _ sort ')-> page ($ page) -> select ();
// Print_r ($ result );
Return $ result;

}
-------------- Gorgeous split line ----------------
The parameters corresponding to the above color cannot be understood, especially web_page '=> array ('like', $ web_page. '%') %, which is dizzy. what does the author want to express?
------ Solution ----------------------
Array ('like', $ web_page. '%') does not appear in the code you post, so your problem is somewhat untitled.
However, in the form of arrays, this should be the parameter format encapsulated by ORDBMS and eventually translated into the linke 'xxxx % 'clause of the SQL command.

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.