We first prepare the MySQL data table, assuming that the project has a record of student information table student, and there are id,name,sex,age to record the student's name, gender, age and other information.
CREATE TABLE ' student ' ( ' id '
Before introducing the Yii built-in UI components, let's look at how to customize the components, which also helps to understand the use of cwidget, which is the Init () and run () method of overloading CWidget.
Class Mywidget extends
anonymous functions
When it comes to closures, we have to think of anonymous functions, also called closure functions (closures), which seems to be the main implementation of PHP closures. Declaring an anonymous function is this:
$func = function ()
PHP's Isset () function is commonly used to detect whether a variable is set
Format: bool Isset (mixed var [, mixed Var [, ...])
Function: Detect whether the variable is set
return value:
Returns FALSE if the variable does not exist
Returns FALSE
PHP has been adding a magic method called __invoke since version 5.3, which allows the object to be called directly after the instance is created. As shown in the following example:
Class Testclass{public function __invoke{print "Hello World";}} $n
Name resolution rules
Before we describe the name resolution rules, we'll look at some important definitions:
namespace name definition
Unqualified names unqualified Name
Identifiers that do not contain namespace separators in the name, such as
C # Anonymous Methods
As we have already mentioned, a delegate is used to refer to a method that has the same label as it. In other words, you can use a delegate object to invoke a method that can be referenced by a delegate.
The anonymous method
The registration procedure unifies the single entrance, the core judgment is the Checkip place, only needs to make a game_id judgment in the non-real-name authentication template procedure. Because too sure, anxious to get off the psychology,
The example in this paper describes how to get all the fixed seed links in a Web page in bulk by PHP. Share to everyone for your reference, as follows:
Often download links more time, like once all the links added to Thunderbolt or electric stove,
The paginate in CakePHP's controller is a function that gets paged data. With the helper's paginator, it's easy to make a page list, sort the list page.
But when I started learning to use cakephp, I had a problem that always bothered me.
How does
PHP Magento Backstage No solution
Many friends may have the same experience, Magento in the server configuration domain name is normal access, but after the local configuration can not log in the background, the account password login when found
Velocity Fifth Application Example---get an index of the current iteration
#foreach ($key in $map. KeySet ()) $velocityCount > $key: $map. Get ($key) #end $ Velocitycount get the current iteration index Velocitycount variable name can be modified
error level for PHP
First you need to know what PHP errors are. Up to php5.5, a total of 16 error levels
Note: When trying the following code, make sure to open error_log:
Error_reporting (E_all); Ini_set (' display_errors ', ' on ');
E_error
This
If a method needs to accept a callback method as a parameter, we can write
Output:
Do STH callback
But we are not sure whether the callback method can be called, so there is a lot of extra work to be done to check whether this callback method
Although you can resize a picture arbitrarily by specifying the width and height of the image in HTML, this method does not reduce the number of pixels in the image. The size of the graphics file does not change, and of course it does not speed up
The basic usage of PHP regular expressions is described in this article. Share to everyone for your reference, as follows:
demo1.php
demo2.php
demo3.php
demo4.php
demo5.php
The
demo6.php
demo7.php
demo8.php
demo9.php
demo10.php
demo11.php
In PHP, the identity of the user is often authenticated. This article is intended to discuss the processing of the password, that is, the encryption of the password processing.
MD5
I believe that many PHP developers in the first contact with PHP,
Before a blog called The Magic Lab read a "PHP session principle of thorough analysis" of the article, the author from the point of view of the use of the session is very good in the code in the course of operation, the changes in each link and
The integer type is Interger, and in 32-bit operating systems, the valid range is -2146483648~+2146483646. Integer values can be specified in decimal, hexadecimal, or octal, preceded by an optional symbol "-" or "+" to identify positive or negative.
There are some problems with split today. Or the function is not deeply understood, close-up to make a mark
First look at the definition of two methods:
Function prototype: Array split (String $pattern, string $string [, int $limit])
Function
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