Ps:1. Capturing PHP syntax errors2. Serious errors
It is not possible to capture these two types of errors with normal set_error_handle, which is a technique to catch such errors
Copy Code code as follows:
test.php page
error_reporting (0)
This article describes the PHP $_get and $_post Filter SQL injection method, share for everyone to reference. The specific analysis is as follows:
This function can only filter some sensitive SQL commands, such as id=1, we still need to filter
First, let's talk about the difference between \ R and \ nEnter "(carriage return) and" line feed "the origins and differences between the two concepts.Before the computer appeared, there was a gadget called the teletype Model 33,linux/unix, which
This article describes the PHP page to achieve the timing of the jump method, shared for everyone to reference. The implementation methods are as follows:
PHP Timer Jump We need to use the header function input HTML or JS code to achieve a timed
Get a picture upload, anyway, later found to be PHP parameter configuration problem.
The following summary with the file upload related PHP parameters, Memo ~
All of these parameters are set in php.ini.
1.file_uploads
Set to on to allow uploading
This article describes three ways to generate static HTML files in PHP.
1, the following use of a template version of a Method!
Copy Code code as follows:
$fp = fopen ("templets.html", "a");
if ($fp) {
$fup = Fread ($fp, FileSize
All the time in the project shows the 2014-10-20 10:22 looks very stiff. In micro-blog, QQ space and other sites will usually show a few seconds ago, a few minutes ago, hours ago, such as easy to read time, we call it a friendly time format. So how
The PHP cookie can not use the dot (period), is not very strict, it should be said can use the dot number of the cookie name, but will be converted, you name a cookie:
$_cookie[' my.name '] = 1;
You can't actually find this value in a cookie by '
The following functions can be used to replace the PHP built-in is_writable function
Copy Code code as follows:
Can be used to replace the PHP built-in is_writable function
function IsWritable ($filename) {
if (Preg_match ('/\/$/',
Because the PHP process does not support multithreading, some scenarios to facilitate and improve performance, you can use PHP to achieve multiple processes to compensate for this problem:
Copy Code code as follows:
#!/usr/bin/env PHP
The first of these methodsCreating a view according to the method of Yii system is a bit of a hassle and it's easier to use Smarty. Try to add the Smarty template in.
Copy Code code as follows:
Date_default_timezone_set ("PRC");
As shown below:
Copy Code code as follows:
/*** Entry function* Save this file as processopera.php* Run/usr/local/php/bin/php processopera.php in Terminal &* View process PS Aux|grep PHP*/Processopera ("RunCode", Array (), 8);
/**
*
Copy Code code as follows:
/******************************************************
* Bit on the low front algorithm
* @param $x
* @return int
*/
function reverse ($x)
{
$result = 0;
for ($i = 0; $i {
$result = ($result >
PHP's header function can implement META tags in HTML code with very little codeHere only to use the header function to do the page jump
1. Code for jump of page in HTML codeHTML Meta Refresh refresh and jump (redirect) pageRefresh property
1.1.1 Zval StructureZend uses the ZVAL structure to store the values of PHP variables, which are as follows:
Copy Code code as follows:
typedef Union _ZVALUE_VALUE {
Long lval; /* Long Value * *
Double Dval; /* Double Value * *
First, to use curl_setopt This function must be compiled inside the server curl this component, how to install the component, please specific to Google search
ii. explanation of Curl_setopt's PHP help documentation
bool curl_setopt (INT-ch, string
Copy Code code as follows:
$im = Imagecreatefromjpeg ($_file["Upload"] ["tmp_name"]); You want to draw water examples of pictures
$watermark = Imagecreatefrompng ("Smiley.png"); Path to a watermark map
$im _x = Imagesx ($im);
$im _y =
The example in this article describes the way in which PHP implements SOAP communication. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
function HttpSoap ($server, $port, $url,
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