During development, we should pay attention to preventing SQL injection. Therefore, we must process the values submitted in the form to update the data to the database.
PHP functions. Any value can be passed for conversion.
CopyCodeThe Code is as
Add it to head.htm, that is, add "$ stime = microtime (true)" to the default template. // obtain
ProgramExecution Start Time"
CopyCodeThe Code is as follows: $ Stime = microtime (true); // gets the time when the program starts to run.
$ Guidefid [
In the past, I used to write a trigonometric curve dynamically using ActionScript. In fact, PHP also outputs a trigonometric curve very easily.
CopyCode The Code is as follows: Define ("max_width_pixel", 600 );
Define ("max_height_pixel", 240 );
Problem:Both functions are for string escaping so that they are suitable for file names. Which one should I use? Which is more standard?
Conclusion:Rawurlencode complies with RFC 1738,Urlencode implements the traditional method. The main
The copy difference between pH and C # values (if not, I hope to point it out !)
$ A = 2;
$ B = $ A; // in PHP, point B's address to a, so B is equal to 2 at this time. The difference lies in this
$ A = 5; // at this time, PHP re-writes the value
Recommended a simple and practical image scaling tool SimpleImage, refer to http://www.white-hat-web-design.co.uk/blog/resizing-images-with-php/
Usage:
Set width and height, and scale proportionallyCopy codeThe Code is as follows: Include
I think it is necessary for me to write this tutorial, because most of the applications I have seen about Automatic completion only give you a program source code package and then tell you how to use it, instead of telling you how it works and why
1. foreach ()Foreach () is the simplest and most effective way to traverse data in an array.# Example1:
Copy codeThe Code is as follows: $ Colors = array ('red', 'blue', 'green', 'yellow ');
Foreach ($ colorsas $ color ){
Echo "Do you like $ color?
One of the differences between this, self, and parent in {1} PHPObject-Oriented Programming (OOP) has become a basic skill of programmers. Using OOP for advanced PHP programming makes sense to improve PHP programming capabilities and plan the web
Definition and usageThe htmlspecialchars () function converts some predefined characters into HTML objects.
The predefined characters are:• & (And number) become &• "(Double quotation marks)"• '(Single quotes)'• •> (Greater than)
List ()(PHP 4 and PHP 5)List-specify variables as if they are an arrayDescriptionVoid list (mixed $ varname [, mixed $...])Like arrays (), this is not a real function, but a language structure. A list () is a job used to specify a variable in the
Generate a QR code online using the api that generates a QR code online by google.
The Code is as follows:
Copy codeThe Code is as follows:
QR code generation -www.jbxue.com
$ Content = $ _ GET ['content'];
$ Width = $ _ GET ['width']? $
Every variable in PHP has a scope for it. It refers to a field in which variables can be accessed (and thus its value. For beginners, the scope of variables is the page where they reside. Therefore, if you define $ var, the rest of the page can
1. Client pages use AJAX technology to request serversAdvantages:The simplest and fastest way is to embed AJAX calls in the HTML code returned to the client, or embed an img tag. src points to the time-consuming script to be executed.
Disadvantages:
Zend Guard is used to protect PHP source code from decompilation and viewing, custom modification without authorization, and unauthorized use and re-release. In addition, it is developed by PHP's Zend company and is a completely customized protector
1. Poor Support for RecursionRecursion is a function calling mechanism. This is a powerful feature that can make some complicated things very simple. A recursive example is quick sort ). Unfortunately, PHP is not good at recursion. Zeev, a PHP
Summary of optimizing PHP code skills1. If a method can be static, declare it as static, and the speed can be increased by 1/4;2. The echo efficiency is higher than that of print. Because echo does not return a value, print returns an integer;3. Set
Curl is a very powerful function in php. Every php programmer should learn and be familiar with curl. Make sure that your php_curl extension is enabled before using curl.
I. curl usageFor example, we collected the first page of PHP recruitment for
Nginx CacheNginx has two caching mechanisms: fastcgi_cache and proxy_cache.Let's talk about the differences between the two cache mechanisms.Proxy_cache is used to cache the content of backend servers. It may be any content, including static and
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