This article summarizes some of the functions commonly used in PHP application development, these functions have character operation, file operation and some other operations, share for everyone reference. Specifically as follows:
1, PHP encryption
This paper illustrates the method of PHP+MYSQLI transaction control to realize bank transfer. Share to everyone for your reference. The specific analysis is as follows:
Transaction control, which means that all statements are executed successfully
Grammar
sprintf (format,arg1,arg2,arg++)
Parameters
Description
Format
Necessary. Conversion format.
Arg1
Necessary. Specify the parameter to be inserted into the first% symbol in the format string.
The Number_format () function formats a number by a thousands group.
Grammar
Number_format (Number,decimals,decimalpoint,separator)
Parameters
Description
Number
Necessary. The number to format.If no other
As the title, how does PHP automatically recognize the content of Third-party restful APIs, automatically rendering into JSON, XML, HTML, serialize, CSV, PHP, and other data?
This is not difficult, because the rest API is also based on HTTP
Chart Gallery
The following class library allows you to create complex diagrams and pictures. Of course, they need the support of the GD library.
Pchart -a library in which you can create statistical charts.
Libchart -This is also a simple
1 in the SQL statement you can add a restriction condition: Left (text,20) only the first 20 words of the text;
2 can be used as pagination using limit FromRecord, recordnum, for example, limit 0,30 indicates that 30 records are traversed from the
This article illustrates how PHP obtains the Youku video true FLV file address. Share to everyone for your reference. The specific analysis is as follows:
There is a webmaster want me to help it do a Youku video site can automatically test the FLV
The example of this paper is to analyze the way that PHP prevents form recurrence by recording IP. Share to everyone for your reference. The specific analysis is as follows:
This principle is relatively simple is the first time the user submitted
This example summarizes the way PHP reads the contents of a file. Share to everyone for your reference. Specifically as follows:
Here's a summary of five ways PHP reads the contents of a file. In practical application, please pay attention to close
The pages that generate static pages are very simple to define templates and template headers, and then replace them with Str_replace, which is the most common method, the other is to use ob_get_contents output to generate HTML, and one of the less
The text displayed in the image also needs to be painted in a coordinate position. In PHP not only support a lot of font library, but also provides a very flexible method of text rendering. For example, draw scaled, italic, rotated text, and so on
This article illustrates the use of File_get_contents Crawl Web page in PHP to solve Chinese garbled problem. Share to everyone for your reference. The specific methods are as follows:
The file_get_contents function is inherently a very good PHP
First, direct call method
Copy Code code as follows:
function test ($a, $b)
{
Echo ' Test one: '. $a. $b;
}
Call the test method, Array ("ASP", ' php ') corresponding to the corresponding argument
Call_user_func_array (' Test ', Array (
This example describes the ping port function of the PHP implementation. Share to everyone for your reference.
The specific implementation code is as follows:
Copy Code code as follows:
/*
* @author Xujiajay
* @date 2010-10-7
*
How do I convert four fields to an integer with a point-to-point IP network address protocol? PHP has such a function ip2long.
Copy Code code as follows:
Echo Ip2long ("10.2.1.3");
?>
we will get167903491
How this is
Copy Code code as follows:
/* Simple implementation of recording data using a text file * *$counter = 1;
if (file_exists ("Mycounter.txt")) {
$FP =fopen ("Mycounter.txt", "R");
$counter =fgets ($FP, 9);
$counter + +;
Fclose
Note: Unlike other object-oriented programming languages, in PHP, a class cannot use the final modifier on an attribute variable.
If you want to declare a property as a constant, you can use the Const keyword, and you do not need to use the dollar
This example describes the way PHP uses Ob_start to generate HTML pages. Share to everyone for your reference. The specific methods are analyzed as follows:
Ob_start ([string output_callback])-Open output buffer
All output information is not sent
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