The following are some of the experiences that we end up with when we develop a project at Shun Yi Network.
Create Console Application
Create a command line app
In advance template There is already a file yii. And there is no need to run it as PHP,
1. Introduction
Smarty is one of the most famous PHP template engines in the industry, which is a PHP template engine written using PHP. It separates the logic code from the external content, provides an easy-to-manage and useful way to separate
Discuz when registering, the password will be encrypted according to a rule.
Like my password is 123456.
Copy the Code code as follows:echo MD5 ("123456");
Will output:
Copy the Code code as follows:e10adc3949ba59abbe56e057f20f883e
The value of the
1. You can use the Func_get_args () and Func_num_args () functions to implement the functions of overloading!!
PHP Code:
Copy the Code code as follows:function rewrite () {$args = Func_get_args ();if (Func_num_args () = = 1) {Func1 ($args [0]);}
In general, we can direct the user to download a file by directly directing the URL to a file located under document root.
However, to do so, there is no way to do some statistics, permission checks, and so on. So, many times, we use to let PHP to
The validity of the PHP validation date has a built-in function, the Checkdate function, which shares the definition and usage of the checkdate function.
Checkdate Definition and usage
The Checkdate () function validates a trellis-high-date. If the
For the local, we can take advantage of the Windows own find to find out, but for the online, such as the search FTP space inside the file, this program is very useful.
Use effect:
PHP file Finder Source:Copy the Code code as follows:
PHP
Notification mechanism implementation, the official only documents do not have the demo code, for the people who did not have to spend a lot of time to do the test.
From the point of view of the document, each notification comes over the data, the
Simple PHP gets the Linux server state code, not much to say-directly on the function:
Copy the Code code as follows:function Get_used_status () {$fp = Popen (' top-b-N 2 | grep-e "^ (cpu| mem| Tasks) "'," "R");//Get a moment of system CPU and
Monday
echo Date (' y-m-d ', (Time ()-((Date (' W ') ==0?7:date (' W ') ')-1) *24*3600)); W is the number form of the day of the week, where 0 is Sunday
This Sunday
echo Date (' y-m-d ', (Time () + (7-(' W ') ==0?7:date (' W ')) *24*3600)); Also
# # $ARGV or $ARGC
$ARGV contains an array of parameters that are passed to the current script when it is run on the command line. $ARGV [0] is the script file name.
$ARGC contains the number of parameters that are passed to the current script when
In order to achieve integration, the Internet to find a lot of information! Tried many times, and finally successfully integrated! Next I will share the process of integration to everyone, hoping to provide help to those who need it
The following are some of the experiences that we end up with when we develop a project at Shun Yi Network.
Three issues encountered in using the YII framework
1. The problem of introducing global variables in main.php file
To revert to this
CodeIgniter is an application framework
1, Free: CodeIgniter is authorized by Apache/bsd-style Open Source license, you can use it as long as you wish.
2, simple: CodeIgniter is really lightweight, the core system only need some very small library.
3
PHP application More and more, also more and more extensive, in order to increase the rich and colorful website, thus appeared a lot of new technology. Ajax is a modern web site can not be missing a technology, he can asynchronously refresh the data,
Today, I found an article in PHP that introduces a space in a replacement string in a comma ', ' and keeps a diary.
Copy CodeThe code is as follows:
/** The space in the keyword is replaced by ', '*/Public Function Emptyreplace ($STR) {$str =
HTML code:
Copy the Code code as follows:
Simple Verification Code
JS Code:
Copy the Code code as follows:function Chkyzm (form) {//Verify the verification codeif (form.yzm.value== "") {Yzm1.innerhtml= "x verification code cannot be empty";}else
Today in the image upload to verify the MIME value of the image suddenly found that the individual special circumstances Finfo_file get MIME value can not be used directly,
According to the official wording,
$finfo =finfo_open (fileinfo_mime);$mime =
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