Does it sound dizzy ?!! Use php to operate php pages. There is a small purpose. In a system, there may be some small items that cannot be stored in the database, but we need to call them frequently on other pages and update them, then we can solve
# Phpchina debut #
Smarty has always been regarded as a superfluous thing. I think there is nothing more than Smarty. Today, I will teach you how to write a template engine so that you can write your own template engine. After reading this article,
For Magic quotes, PHPer is a common issue. I accidentally saw an article today, combined with PHP Manual and his reply, and made a simple summary here.
In short, Magic quotes automatically escapes the input data when it is enabled. All single
1. Generate a random numberUse the for loop to generate several random numbers.Use a random function to generate a random number within the specified range. For example, rand () generates numbers between 1 and 15.Use a hexadecimal function to create
I wrote this function today and shared it with my php100 friends.Step 1. Extract all from the article using the regular expression.$ Message // document content// Regular (this is not yet)$ Reg = "/] * src =" (http ://(. + )/(. + ). (jpg | gif |
When running the jQuery code in the book today, I don't know whether it was a mistake in the book or a problem with my jQuery version. In the example above, a jQuery function does not exist, that is, the contains function, this function is used to
Recently, I used the cURl library function in a small project. I found some information from the Internet and summarized it by referring to a foreign blog and official manual.Function get_web_page ($ url){$ Options = array (CURLOPT_RETURNTRANSFER =>
After using the static page plug-in cos-html-cache generated by wordpress, after each article is commented, the information of the previous reviewer is always displayed, including the information displayed when the cookie is cleared: welcome to XXX
Header (Content-type: text/html; charset = UTF-8 );
If (! Function_exists (file_get_contents) {// if the system does not have the file_get_contents () function
Function file_get_contents ($ file) {// write the file_get_contents () function by
Work needs, write a simple PHP image watermark function.
/*
Image Watermarking Function
$ Imag_url is the path of the image to be watermarked
$ Str: string to be added to the image
$ Path for storing the route watermark
*/
Function
Two commonly used functions in php: encode_json () and decode_json ();We will focus on the solution for garbled characters in the encode_json () function during Chinese encoding.First, we will write out the required array:$ Json = array (0 =>Array
This topic describes how to connect PHP5 PDO to a database.1. About PDOPDO (PHP Data Object) is a new feature added to PHP 5, because php4/php3 before PHP 5 were a bunch of database extensions to connect to and process various databases, such as php_
During development, a page is refreshed and the article function is randomly obtained. The array_rand () function in the PHP function is used. array_rand (array, number) has two parameters, the array parameter indicates that you want to obtain an
PHP custom functions: Clear all js, html, and css code on the page
$ Search = array (" si ", // remove javascript
" si ", // remove css
"] *?> Si ", // remove the HTML Tag
"] *?> Si ", // remove the annotation mark
"([Rn]) [s]", // remove
1. Summary: to learn any language, you need to read more, read more, and ask more !! Writing programming is a perfect thing! Because there is so much knowledge, you will feel the same when you look at it.Programmers are fried with cold meals, over
The strcmp () function compares two strings.Strcmp Syntax:Strcmp (string1, string2)Parameter descriptionString1 is required. Specifies the first string to be compared.String2 is required. Specifies the second string to be compared.This function
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