The order Method of the ThinkPHP CURD method is one of the coherent operation methods of the model.Used to sort operation results.
The usage is as follows:
$ Model-> where ('status = 1')-> order ('Id desc')-> limit (5)-> select ();
Note:Coherent
Sometimes we may encounter the problem of filtering special characters in strings. This article provides a method to process special strings, which may be missing. If you find it, please leave a message and tell me. Thank you.Copy codeThe Code is as
1. jquery obtains the single-choice group radio$ ("Input [name = 'name']: checked"). val ();
2. jquery obtains the next value of radiobutton.$ ("Input [name = 'name']: checked"). next (). text ()$ ("Input [name = 'name']: checked"). val ()
3. jquery
Php basic exercises-Image Scaling:Copy codeThe Code is as follows:/*** Image zoom.*/Function imageZoom ($ filename, $ w, $ h ){/* Arguments meaning *//* $ Filename: the source of the name *//* $ W: you want get the image's width *//* $ H: you want
1. How to obtain the module name and controller name through the address bar parameters (even if there is a route and a rewrite module is enabled)
2. How does tp implement the pre-and post-method functional modules and how does it execute methods
Copy codeThe Code is as follows:Class xtable{Private $ tit, $ arr, $ fons, $ sextra;Public function _ construct (){$ This-> tit = array (); // strings with titles for first row$ This-> arr = array (); // data to show on cells$ This-> fons = array ("#
Randimage. php
Copy codeThe Code is as follows:/*+ ----------------------------------------------------------- +| By Bleakwind http://www.weaverdream.com+ ----------------------------------------------------------- +*/$ Dir = "images/"; // image
When we write a program, it is inevitable that there will be problems (which often occur). When PHP encounters an error, it will give the location, number of lines, and the cause of the error script. Many people say that this is no big deal. Indeed,
Copy codeThe Code is as follows:Function chineseFirst ($ str){$ Str = iconv ("UTF-8", "gb2312", $ str); // if the program is gbk, comment out this line// Judge whether all strings are ChineseIf (preg_match ("/^ [\ x7f-\ xff]/", $ str )){$ Fchar =
Copy codeThe Code is as follows:Class Page {// Number of pages displayed on each page in the pagination barPublic $ rollPage = 6;// Parameters to be included during page redirectPublic $ parameter;// The number of lines per page in the default
PHP paging has many methods. Today we will use a small example to demonstrate this function.Copy codeThe Code is as follows:$ Result = " ";// Previous PageIf ($ offset> 0 ){$ Result. = " Prev ";}$ Pages = $ allPageNums; // total number of pages$
Check boxes are often used in web forms. How can I use PHP to determine which check boxes are selected in the submitted Form and read the data in them.
First, create a form: form.htmlCopy codeThe Code is as follows: 3 7 1 15
Create a form
I have the habit of cutting nginx logs on the server every day. Therefore, for visits from various search engines every day, I can always record some 404 page information. Traditionally, I only occasionally analyze the logs, however, it may not be
The in label and range label of the ThinkPHP template are usedDetermines whether a template variable is within a certain range..1. in tagThe in tag of ThinkPHP is used to determine whether a template variable is within a certain range. The format is
When we need to collect the content of a webpage on the network, if the images on the target website are anti-Leech, the images we directly collect are not available on our own website. Then we use the program to download the images on the target
Htmlspecialchars, strip_tags, and addslashes of PHP are common functions in Web application development. Today we will detail the usage of these functions:
1. function strip_tags: Remove HTML and PHP tags
Note: This function removes any HTML and
PHP has a function called similar_text () to calculate the similarity between two strings. A percentage can be obtained to indicate the similarity between the two strings. The effect is as follows:
Similar_text ('aaa', 'aaa', $ percent );
Var_dump ($
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