PHP generates static page fopen fwrite

function makehtml ($msgContent, $filePath, $fileName) {//Generate HTML file if (!is_dir ($filePath)) {@mkdir ($filePath);} $handle = fopen (str_replace (' \ ', '). /', $filePath. $fileName), ' w+ ') or Die ("can ' t create file! $fileName");

PHP Reference (&) Example Tutorial

PHP reference (is to precede the variable or function, object, etc. with & symbol) References in PHP mean that different names access the same variable content.There is a difference between the pointers in the C language. The pointer in C language

PHP Regular expression (pattern modifier)

Eighth chapter (3) Regular expression (pattern modifier)Matching sequence of regular expressions:1. Mode Unit 2. Duplicate match? * + {} 3. boundary limit ^ $ b b 4. Mode selection |Pattern modifier:The pattern modifier is marked outside the entire

PHP Array Correlation processing function

Here are some commonly used PHP array functions, we will test the use of PHP array arrays OH Sixth chapter (3) The correlation processing function of the arrayCurrent (array name) outputs the value of a string in an array, starting with the

How to declare a PHP string

Fifth chapter (1) method of declaring stringsThe definition of the string:Double quote "" 1. You can execute variable 2 in double quotes. You can use the escape characterSingle quote ' 1. Cannot execute variable 2 in single quotes. Only partial

Monitor php-fastcgi Timeout restart script in Linux

Scripting code The code is as follows Copy Code if [-e/var/lock/subsys/502]ThenKillall-9 Curl 2>/dev/nullKillall-9 PHP-FPM 2>/dev/nullKillall-9 php-cgi 2>/dev/nullService PHP-FPM Start >/dev/nullecho "[' Date +

Linux Installation configuration PHP environment 2 ways

PHP Installation Configuration Method One 1. Get installation files: http://www.php.net/downloads.php php-5.3.8.tar.gz To obtain the support files needed to install PHP: http://download.111cn.net/download/netlong339/1351852 libxml2-2.6.32.tar.gz 2

Linux Install the PHP solr extension step detailed

Download the latest version from HTTP://PECL.PHP.NET/PACKAGE/SOLR. Run after decompression: Phpize ./configure Make install Copy an extended file under the/ETC/PHP.D, and change the load extension to solr.so. Restart php-fpm load SOLR extension:

Php curl for HTTPS access

I wrote a simple php curl encapsulation function that supports HTTPS three years ago. At that time, I only knew why. Now I will take a look at it in detail.Https server post data The code is as follows:Copy code Function curlPost ($ url, $ data,

Php mobile folder and file program code

Method 1: copy + unlinkMy idea is: move = new + delete. Create a folder in the target directory before moving the folder, copy the file and directory, and delete the folder. The code is as follows:Copy code /*** @ ParammoveDir cut the file and

Php generates N non-repeated random number instances

It is not difficult to implement this function, but I have learned a lot. The code is as follows:Copy code /*** Generate a certain number of non-repeated random numbers* @ Param int $ min, $ max specifies the range of random numbers* @ Param int

Php generates multiple random number instances

The code is as follows: The code is as follows:Copy code // Range is an array of columns from 1 to 100.$ Numbers = range (1, 1,100 );// Shuffle will immediately disrupt the array orderShuffle ($ numbers );// Array_slice retrieves a segment of

Exercise caution when operating the database during loop iteration of PHP programs

PHP has always believed that the database is omnipotent, but efficiency and database bottlenecks are seldom considered for the purpose of implementing functions. For example, when you query a database in a loop, it is very undesirable to query the

Php url Shortening code (generate short url)

Each URL is replaced by 6 characters, and (32 ^ 6) can have up to 1,073,741,824 short URLs. Of course, you can also record more detailed information, such as access records and creation time. If it is not enough, you can delete it for a long time.

Php ckeditor solution

Open commands. php in the editor/filemanager/connectors/php directory and find the FileUpload function. The code is as follows:Copy code $ SExtension = substr ($ sFileName, (strrpos ($ sFileName, '.') + 1 ));$ SExtension = strtolower ($

Php computing Time difference: computing article posting time from now

The code is as follows:Copy code /*** Time difference calculation*/Function time2Units ($ time){$ Year = floor ($ time/60/60/24/365 );$ Time-= $ year * 60x60*24*365;$ Month = floor ($ time/60/60/24/30 );$ Time-= $ month * 60*60*24*30;$ Week =

PHP recursive file and directory deletion functions

A recursive function is a self-called function that calls itself directly or indirectly in the function body. However, you must set the self-called conditions. If the conditions are met, the function itself is called, if not, terminate the

PHP cookie usage and precautions

PHP cookie usage The code is as follows:Copy code Setcookie ('mycooker', 'value ');// Function prototype: int setcookie (string name, string value, int expire, string path, string domain, int secure)Echo ($ mycookie );Echo ($ HTTP_COOKIE_VARS

PHP checks whether the file is modified.

Key technologiesThis example mainly uses the filectime () and filemtime () functions to detect the last change time and last modification time of the incode of the file, and uses the date () function to format the timestamp returned by the detection.

In php-> and

"->" (Minus sign, right angle bracket)Used for functions or objects in the category class, such: The code is as follows:Copy code Class Test {Function do_test () {echo "Doing foo .";}}$ Bar = new Test; $ bar-> do_test ();?> "=>" (Equal sign,

Total Pages: 12780 1 .... 3327 3328 3329 3330 3331 .... 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.