Comments_template () (Get comment template)
The Comments_template () function is used to get the comment template, which can only be used on articles or pages, if not the article or the page will not be displayed.Usage
Comments_template
Using MVC in PHP has become increasingly popular, especially in some open source frameworks. MVC is enough to deal with most situations, but there are some things that are not appropriate, such as simple personal blog, for only hundreds of article
Copy Code code as follows:
/**
by Lenush;
*/
Class Tree
{
var $data = array ();
var $child = array ( -1=>array ());
var $layer = array ( -1=>-1);
var $parent = array ();
function tree ($value)
{
$this->setnode (0,-1, $value);
First of all, let's meet restful.
RESTful is a design style rather than a standard, such as an interface: HTTP://WWW.TEST.COM/USER/VIEW/ID/1
Represents obtaining user information with ID 1, which can be changed if the restful style is used:
Http:/
This article describes the simple way to open curl PHP. Share to everyone for your reference, specific as follows:
First, the question:
The Windows host has a "call to undefined function Curl_init" error prompt with no defined function, which
The example of this article analyzes each and list usage in PHP. Share to everyone for your reference, specific as follows:
The use of 1.each
Look at the API first
Array each (array & $array)
The API describes this: each-returns the current
Share an auxiliary function, using PHP to identify the numbers in the string as much as possible,
First up code
function Checknatint ($str) {$map = array (' One ' => ' 1 ', ' two ' => ' 2 ', ' Three ' => ' 3 ', ' Four ' => ' 4 ', ' Five ' => '
This example describes the use of the list () function in PHP. Share to everyone for your reference, specific as follows:
The list () function in PHP is used to assign values to a set of variables in one operation.
Note : The array variable here
Copy Code code as follows:
Set up the files we are going to use
$srcurl = "http://localhost/index.php";
$tempfilename = "tempindex.html";
$targetfilename = "index.html";
?>
Generating
generating ...
First delete the
PHP has only categories (Class), methods (method), attributes, and single inheritance (extensions). For users who are not accustomed to using C + +, Java, Delphi and other object-oriented language to develop programs, it may be useful to read a book
Basis
Common Methods for cookies:
$_cookie[' Recordluhuidudu '] get cookiesSetcookie (' Recordluhuidudu ', ", Time () -3600*24*30); Setcookie (field name, data, expiration time); Set cookies
Attention
The same way to delete cookies is to reset
Regular expressions are a very important knowledge point in PHP, often used to find and replace strings, the most common is to verify that the user entered the information format is correct, such as message format, phone format, and so on. There are
In general, PHP is rarely used to execute Linux commands, but you might use them in special cases. I used to know that there are two functions that can execute Linux commands, one is exec, the other is shell_exec. In fact, there are many, combined
PHP calculates the number of hours and breaks it down
Copy Code code as follows:
/* Author: Yangyu yangyu@sina.cn * *
Parameter $hours_min array with a format of 1:10, returned to 1 hours
/*
For example:
$hours _min[0] = ' 1:1
Now the application of jquery is more and more extensive, in many websites news section has realized the label classification + does not refresh the paging effect.
Also try to write one yourself, the effect diagram below (style can be done according
Copy Code code as follows:
/**
* Traverse the directory to find all files of a suffix name in the directory
* */
function Viewdir ($directory, $ext) {
if (Is_dir ($directory)) {
$handle = Opendir ($directory);
while ($file = Readdir
Verification code in the form to achieve more and more, but with JS write the verification code, always feel inconvenient, so learn the next PHP implementation of the verification code. Well, there is nothing to do, but do not want to waste time, so
If the number of record bars on the left is less than the $space (page segment) value, the page number $start from 1 to the right. If the number of record bars on the left is more than $left (the left and right pages are displayed), $start the
In this paper, an example is given to analyze the autoload.php automatic loading usage of codeigniter configuration. Share to everyone for your reference, specific as follows:
CodeIgniter has the function of automatic loading, it can load class
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