One: PHP has a lot of system predefined variables, by judging them can simply determine whether the server system is windows or *unix, where the relevant functions or predefined variables are as follows:
Php_uname (), Php_os, Directory_separator,
Use PHP's Ob_start ();
Control your browser cache
The output control function gives you the freedom to control the outputs of the data in your script. It is very useful, especially when you want to output a file header after the data has been
The process of page output in previous versions of thinkphp is to read the template file and then parse it (also support invoking third-party template engine parsing), but in some cases we do not define the template file, or save the template file
Recently, the ability to send mail was sent using the mail () function from PHP. PHP mail () This method is very simple, convenient, easy to use, but in addition to NetEase mailbox, QQ mailbox, Gmail mailbox and other commonly used mailboxes can be
CodeIgniter mkdir Create directory encountered permissions issues and workarounds, Codeignitermkdir
Today when uploading files with CodeIgniter (deployed in Centos), the following error is indicated:
A problem is encountered while attempting to
Output Control,outputcontrol of PHP cache mechanism
---------------------------------------------------------------------------------------------------------
php5.2 version of the configuration, the default output_buffering is off state, run the
The following function can be used to filter the input of the user to ensure that the input is XSS-safe. Specifically how to filter, you can see inside the function, there are comments.
Copy CodeThe code is as follows:
function Removexss ($val)
The thinkphp has built-in form token validation to effectively protect against security such as remote submission of forms.
The configuration parameters related to the form token validation are:
If the form token verification feature is turned
The Perfect 2 php detection string is utf-8 encoded function sharing, string utf-8
In PHP development sometimes use transcoding functions, such as iconv (), mb_convert_encoding () function, when using the function transcoding or decoding time we
thinkphp empty method Display, thinkphp
TP If a controller does not have a method, as long as there is a template, the URL corresponds to the display template name.
Example
Http://localhost/yiyunmap/map/test
Map Controller does not have the test
V. User Login (login.php)
At the beginning, we said that the entrance to the game is index.php file; we've installed it, and naturally turned to the login process to start looking.
As usual is a section of the code we have introduced, we will no
1. Get all the pictures in the webpage:
Copy CodeThe code is as follows:
Obtain the content of the location and save it to the $text
$text =file_get_contents (' http://www.jb51.net/');
Get all IMG tags and store them in a two-dimensional array
It is very convenient to read and write XML documents in PHP5, and you can use PHP's SimpleXML method to quickly parse and generate XML-formatted files, as illustrated below:
There are three ways of creating a SimpleXML object:
1. create with the
The difference between error and exception in PHP and its application, errorexception
The difference between error and exception check the online data is mostly Java interpretation, it seems that PHP exception processing process and Java almost
The
A method for ordering a key value of a multidimensional array in PHP
PHP multi-dimensional array sorting can be handled with the Array_multisort () function, the Array_multisort () function can be used to sort multiple arrays at once, or to sort
Analysis of the PHP path blasting problem caused by the file system mechanism of Windows,
1. Opening remarks
This disclosure is a test result of the questions raised on the following
The rounding function code in PHP (floor function, ceil function, round and intval), Ceilintval
The floor function and the Ceil function match each other to make the data processed by PHP more realistic and reliable.
First, look at the floor
PHP is based on php_imagick_st-q8.dll implementation of JPG synthetic GIF image method,
First, overview:
In this paper, PHP is based on php_imagick_st-q8.dll implementation of JPG synthetic GIF image method.First of all to implement PHP using the
PHP Exif extension method to open a detailed
This section mainly describes how to open the PHP Exif extension method, mainly in the php.ini file modification
Server Configuration Description:
1. Locate in the php.ini file; extension=php_exif.dll,
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