Programmers (generally) define a programming language that they know best or are most often used. I amPHPProgrammer, John is a JavaScript programmer, and DHH is a Ruby programmer. Schwarz and Randal are Perl programmers. Every programmer may look at
Arthur J. Riel once said that you do not have to strictly abide by these principles and violate them and will not be punished by religion. However, you should regard these principles as warning bells. If you violate one of them, the warning bells
/*************************************** ******************************************* Email: njj@nuc.edu.cn *************** ******** Date: 2004/10/02 ******************* ********* Reserve the copyright information when you reprint it **************
I wrote several ID card functions, and I personally felt very useful. Especially in the online questionnaire survey, it is very useful to verify the ID card in my personal information, but there are few applicants, you can leave it in your own blog.
Dom xml functionsThese functions are only available if PHP was configured with -- with-dom = [DIR], using the GNOME xml library. you will need at least libxml-2.0.0 (the beta version will not work ). these functions have been added in PHP4.This
// Define output as image typeHeader ("content-type: image/gif ");// Create an image$ Pic = imagecreate (240,30 );// Define the black and white colors$ Black = imagecolorallocate ($ pic, 0, 0 );$ White = imagecolorallocate ($ pic, 255,255,255 )
Definition and usageThis strip_tags () function is used except for all HTML, XML, and PHP tags.Syntax
strip_tags(string,allow)
Parameters
Description
String
Required. Specified string check
Allow
Optional.
Php chmod defines and uses the chmod attribute () function to change the permissions of a specified file. If TRUE or FALSE is returned, the operation fails.
Php chmod definition and usageThe chmod attribute () function changes the permission of the
Magic Quotes is used to filter information that is submitted by a form. if (get_magic_quotes_gpc () echo "Magic quotes are enabled"; else echo "Magic quotes are disabled ";
-Magic quotes of PHPA function called magic quotes was previously created in
Let's take a look at this php copy function tutorial.
Copy(PHP 4 and PHP 5)Copy-copy an objectDescriptionBoolean copy (string $ source, string $ dest [, resource $ background])Make the file a copy source dest.If you want to move the file, use the
Php parse_url function tutorial
Parse_url(PHP 4 and PHP 5)Parse_url-parse the URL and return its componentsDescriptionHybrid parse_url (string $ URL [Abstract $ part =-1])This function parses a URL and returns a URL with an associated array
Php is_executable determines that the file is an executable file
Is_executable(PHP 4 and PHP 5)Is_executable-tell whether the file name is executableDescriptionBoolean is_executable (string $ file name)Indicates whether filename is an executable
Php tutorial string truncation function (supports Chinese UTF-8 truncation)The two Chinese Character truncation function methods provided in this article are mainly used to solve the problem of how utf8 encoding correctly intercepts Chinese
Max () returns the maximum value.
SyntaxMax (x, y) parameter descriptionX is required. A number.Y is required. A number.
DescriptionMax () returns the maximum value in the parameter.
If there is only one parameter and it is an array, max ()
Function isPHPSuch a powerful source, but many PHP functions are not fully utilized. Here, we will briefly introduce 10 uncommon but useful functions.
1. sys_getloadavg ()
Sys_getloadavt () can obtain the system load. This function returns an array
This article introduces a simple file operation function fopen. The fopen function can be used to open, read, and save files. Below I will summarize the operations of PHP files.
Open a file
The simplest Syntax of fopen is as follows:
Fopen (filepath,
This is a frequently used function, and some programs from others ......1. generate random string functionsFunction random ($ length ){$ Hash = '';$ Chars = 'abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxy ';$ Max = strlen ($
Php file_put_contents Function
File_put_contents(In PHP 5)File_put_contents-write a string to a fileDescriptionInternational file_put_contents (string $ file name, mixed $ data [summary $ flag = 0 [, resource $ background])This function requires the
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