Php operations on php files

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

Caterpillar teaches you to write a template engine of your own.

# 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,

PHP disables page cache output

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

PHP unlimited class query parent-layer Functions

ClassID classFID className classCount1 0 China 02 1 Zhejiang 03 1 Jiangsu 04 2 Hangzhou 05 4 Xihu District 0 If FindFather (4, 0) display => Hangzhou FindFather (4, 1) display => Zhejiang FindFather (4, 2) display => China FindFather () display =>

Verification code creation (Network tree comment)

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

PHP collects remote images from articles to a local device

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 |

Generate static pages in batches.

Generate a static page Require_once class. inc/mysql. class. php;$ Db = new DB_MySQL ();$ Db-> query ("select uid from user ");$ Uidrow = $ db-> get_rows_array ();$ Url = "";$ Fp = fopen ("moban.html", "r"); // read-only open Template$ Str = fread ($

A jQuery Extension function

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

PHP100 excellent: PHP generates a bar chart

/* BkJia essence: generate a bar chart in PHP */Function createImage ($ data, $ twidth, $ tspace, $ height ){$ DataName = array ();$ DataValue = array ();$ I = 0;$ J = 0;$ K = 0;$ Num = sizeof ($ data );Foreach ($ data as $ key => $ val ){$ DataName

PHP uses the cURl library function to obtain detailed webpage Information

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 =>

Solution to cos-html-cache plug-in comments

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

Php generates static page html page code

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

PHP function: simple image watermarking Function Code

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

Example of how PHP uses json Chinese garbled code to solve the problem

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

PHP5 PDO Connection database details

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_

Random current article function-PHP array_rand () function

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

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

Six-Point PHP learning experience

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

Introduction to PHP strcmp () Functions

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

PHP watermarks images based on their color levels

Share Source Code directly Function add_wm ($ nmw_water, $ src_file, $ output_file, $ x, $ y ){ If (file_exists ($ output_file )) Return; $ W1 = MagickGetImageWidth ($ nmw_water ); $ H1 = MagickGetImageHeight ($ nmw_water ); $

Total Pages: 12780 1 .... 12289 12290 12291 12292 12293 .... 12780 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.