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 function get_magic_quotes_gpc
Echo get_magic_quotes_gpc (); // sorry, this is 0.
Echo $ _ POST ['lastname']; // Simao 'pig
Echo addslashes ($ _ POST
Phputf8 half garbled
Php utf8 half garbled
A bug occurs on the website, and garbled code occurs on the page header. the header is include a head. php, the whole page is utf8, but I put the head. when php is opened, it is
Php paging code example and use in ZF
$ Nav = ''; // A variable used to save the number of pages
For ($ I = 1; $ I
{
$ Nav. = "page". $ I ";
}
The above for loop will output 1st pages, 2nd
Php searches for the existence of an element in an array.
In the php array, how does one find whether an element exists? You can consider using functions such as array_key_exists, in_array, and array_search. This article will give you a
Php drawing skills how to write Chinese and English on pictures
// 1. create a canvas
$ Im = imagecreatetruecolor (300,200); // create a real-color image. the default background is black and the image
Examples of character escape methods in mysql statements
When inserting a string with single or double quotation marks in the mysql database, if it is a single string, you can consider escaping it with a backslash. what if a large
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
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
Thinkphp paging method and implementation code
/**
* The same code encapsulation of the TODO basic paging makes the front-end code less
* @ Param $ m model, reference transfer
* @ Param $ where query
Example of how to obtain the image size using the phpgetimagesize function
/* 1.jpg: Image of the desired size */
$ Arr = getimagesize ("1.jpg ");
/**
* $ Arr is an array type.
* $ Arr
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
Php paging source code and call example
Class Page {
Private $ total; // total records
Private $ pagesize; // The number of entries displayed on each page
Private $ limit; // limit
Private $ page;
Php paging class code example, which can be used in the php Framework
// Php paging code
Class page {
Public $ page; // current page
Public $ pagenum; // Number of pages
Public $ pagesize; //
Example of combining php paging code with smarty
/**
* Paging class
*/
Class Pager {
Var $ total; // The total number of records.
Var $ pageSize; // number of records displayed on each page
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