Basic php Tutorial-for loop printing hollow diamond
This section describes examples of for loop printing hollow diamond and for loop application for your reference.In the previous section, we introduced the php for loop. in this section, we
Php download code
// Check whether all FORM fields are complete...
If ($ form_completed ){
Header ("Location: http://bbs.it-home.org/download/info_check.exe ");
Exit;
}
?>
Or the
The is_file () function used by php to determine whether a file is used
Var_dump(is_file('a_file.txt '). "\ n ";
Var_dump (is_file ('/usr/bin/'). "\ n ";
?>
Output: bool (true) bool
Php implements ftp upload class and call example
An ftp upload class, similar to an online example, is very simple and suitable for reference by new users.1. file Upload ftp. class. php
FtpUrl = $ ftpUrl;} if ($ ftpUser) {$ this->
Php code used to detect ajax requests
Most JavaScript frameworks, such as jquery and Mootools, send additional HTTP_X_REQUESTED_WITH header information when sending Ajax requests. the header is an ajax request, therefore, Ajax requests
Summary of php method for calling external shell
System ("/usr/local/bin/webalizer ");
?>
Exec ()Prototype: string exec (string command [, string array [, int return_var])The exec () function is similar to
Php converts binary, octal, and hexadecimal formats.
/**
* Convert decimal to binary, octal, or hexadecimal with zero padding before the digits being insufficient *
*
* @ Param array $ datalist
Php user-defined function recursively replaces the content in the array
/**
Desc: recursively replaces array content
Link: bbs.it-home.org
Date: 2013/2/22
*/
Function arrContentReplact
How to create an array in php
Php does not need to specify its size when creating an array. Since php is a loose language, you do not even need to declare it before using arrays. Although there are no strict restrictions, php still
Solution when the array element obtained by fgetcsv is a null string
// The uploaded CSV file, which is usually GBK encoded in Excel,
// While the source code is UTF-8, transcoding is required
Php time zone setting method summary
Function_exists (date_default_timezone_set); // at this point, he always returns 1. this function is used to determine whether the character here is a defined function name.
How to convert data to scientific count when exporting data to excel
// In the excel. php file
$ ObjActSheet = $ objPHPExcel-> getActiveSheet ();
// Set the topic name
$ ObjActSheet-> setCellValue ("b1",
You do not need to re-compile php to add the ftp extension method.
Extension_dir = "/usr/local/php/etc/ext"
# Load module
Extension = ftp. so
# Save and exitNow, the ftp extension is
So that your PHP object can be foreach, and attributes are modified using Private
If you are bored, you can play with it.The traversal object is actually just a specific attribute of the array type in the object.You can use foreach directly
B2Core: 300-line phpMVC architecture
B2Core is a lightweight php MVC framework. the 300-line code encapsulates common CRUD and other practical functions.For the latest code, see the http://b2core.b24.cn, and welcome criticism and
Php generates a random code segment
/*
* Note: generate a random code and display the random code graphically.
*/
$ ViewRandomCode = mt_rand (1000,10000 );
Session_start ();
$ _
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