10 actions that turn you into a bad programmer
Previously, this site published "ten habits of excellent programmers" and "basic skills required by programmers", which we need to learn and cultivate. Here, we mainly discuss the features of
The phpgtimagesize function obtains the image size.
/* 1.jpg image of the desired size */
$ Arr = getimagesize ("1.jpg ");
/**
* $ Arr is an array type.
* $ Arr [0] indicates the image
Php function memory_get_usage () to view the memory currently allocated to the PHP script
Echo memory_get_usage (),''; // 313864
$ Tmp = str_repeat ('http: // www.nowamagic.net/", 4000 );
Echo
Php functions with any number of parameters
// Function with 2 optional arguments
Function foo ($ arg1 = '', $ arg2 = ''){
Echo "arg1: $ arg1 \ n ";
Echo "arg2: $ arg2 \ n ";
}
Foo ('hello',
Php regular expression tutorial 5
Php regular expression full tutorial 5. some examples of php regular expressions
Some examples of php regular expressions: Regular expression description/B ([a-z] +) 1b/gi position where a
Example of php magic function _ call ()
Class {
Public $ name;
Function test1 ($ ){
Echo "test1111 ";
}
Function test2 ($ ){
Echo "test2222 ";
}
// When an
Analysis on the code principle of php + mysql paging query
$ Pagesize = 10; // set the number of records displayed on each page
$ Conn = mysql_connect ("localhost", "root", ""); // connect to the database
$ Rs =
Php paging class (source code + instance)
Share a php paging class, which is well written. we provide two calling instances for this paging class for your reference.
1. php paging code
Number = $ number; $ this-> N_p_p = $ n_p_
Php is the easiest way to generate excel or Word documents
Header ("Content-type: application/vnd. ms-excel ");
Header ("Content-Disposition: filename=test.xls ");
Echo "test1 \ t ";
Echo "test2 \ t \ n"; //
Php regular expression to search for html tags with id attributes in html
In php, use regular expressions to search for all html tags with id attributes in html. This article provides detailed operation methods. For more information, see.
PHP generate UTF-8 encoded CSV file open garbled solution
Php generated UTC-8 encoded csv file, use excel open view garbled, share the solution, for your reference.
Openoffice is opened normally while excel is not opened
Thinkphpmemcache usage example
For usage of memcache in thinkphp, including how to install and run memcache in ThinkPHP, and how to use memcache in thinkphp, refer to the example of using memcache as a cache in thinkphp.
Memcache
Phpreaddir function usage tutorial
$ Dir = "readdir /";
// Determine whether it is a directory
If (is_dir ($ dir )){
If ($ dh = opendir ($ dir )){
While ($ file = readdir ($ dh ))! = False ){
Introduction to the php numeric formatting function number_format, number_format (number to be formatted, number of decimal places to be retained, decimal point string, thousands of delimiters ).
Introduction to the php numeric formatting
Phpapc high-speed cache configuration
Print_r (apc_cache_info ();?>
PHP Warning: apc_cache_info (): No APC info available. Perhaps APC is not enabled? Check apc. enabled in your ini file
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