Content
?if ($_post){InputNo action was made$a = $_post[' content '];echo $a;/*JS CSS A and other HTML tag code A JS dialog box pops up here.This will affect the security of the site and the user experience*/Functions for safe filtering$b =
1. The difference between single and double quotes
Most PHP developers (including me before) don't care much about their usage, but there's a big difference.
The PHP engine allows the use of single and double quotes to encapsulate string variables,
Definitions and usageThe Checkdate () function verifies a Gregorian high date.
If the specified value is valid, the function returns True, otherwise it returns false.
The date is legal in the following cases:
Month between and including 1-12The
PHP Array Operation Instance TutorialEach cell in the data array represents a row in a table. This is the typical way the database holds array data.The data in the example are as follows:Volume | Edition-------+--------67 | 286 | 185 | 698 | 286 | 66
checkbox in PHP to read the value in the array form Oh, we read these values in PHP post fetch is in an array form Oh,
php Get checkbox value for multiple marquee $area _arr = Array ();if ($_get[' action ']== "submit") {$area _arr = $_post[' area ']
Comparison between PHP strtr and Str_replace
Functions have the ability to replace characters. But the STRTR is 4 times times more than the str_replace performance. Specific circumstances, please
Look at the following decomposition:
The first is
Explode (symbols, characters)
The characters processed by explode will eventually be saved in an array form, so let's take a look at an example below.
$t = ' 9,133, Dan County ^14,203, Changsha ^14,206, Hengyang ';
$ar = Explode (', ', $a);
PHP serialize,unserialize function
We often see serialize,unserialize these two functions in PHP, so what are their roles?
Serialize can convert any data into a stored character oh, and then unserialize restore, here we look at
An instance.
Returns timestamp for 12:25:23 9-jul-2006echo Gmmktime (12,25,23,7,9,2006);?>
Gmdate ($format, $ts)
This function formats the UNIX time label as a date string that can be read artificially. This date string is represented as GMT (not local time).
function Htmltemplate ($tag) {$url = "file.txt";//file file contains the data I want to have and is bounded by .$content = file_get_contents ($url); Reading filesif (!empty ($content)) {$array = explode (' ', $content); to data processing and then
The code is as follows:Copy code /*** Weight sorting for arrays* Difference from the array_unique function: it requires that val be a string, and this can be an array/object. ** @ Param unknown_type $ array to which arr is to be duplicated* @
Abstract class:It is used for inheritance and cannot be instantiated. It is used for standardization. Subclass must implement all abstract methods of the parent class.Interface:It can be understood as a stricter abstract class.First, like an
Example The code is as follows:Copy code // Delete all empty directories in the directoryArray_map ('rmdir', glob ('*', GLOB_ONLYDIR )); // Delete all files in the directoryArray_map ('unlink', array_filter (glob ('*'), 'is _ file '));?>
This article mainly implements php image upload to automatically add watermarks to images. In the next article, I will provide code for adding text watermarks with php.It is actually very easy for php to add watermarks to images. It is not as
JSON (json_encode) encoded in PHP)The PHP json_encode () function is used for JSON encoding in PHP. This function returns the value in JSON format. If it fails, FALSE is returned.Syntax:String json_encode ($ value [, $ options = 0]) parameter:Value:
301 jump The code is as follows:Copy code Header ('http/1.1 301 Moved Permanently ');Header ('Location: http://www.abc.com/aaa /');Exit (); Do not miss the header ('http/1.1 301 Moved Permanently '); otherwise, no 301 is returned.404 error page
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