Call method when the function name is variable in php
Function fun ()
{
Echo 'fun ';
}
$ A = 'fun ';
$ ();
?>
The above $ a variable is the fun () function. calling $ a () is
PHP: no output on the Gzip page
Output_buffering = Off
Output_handler =
Zlib. output_compression = On
You can enable gzip acceleration for all site php files.For html files, you can configure the.
Example of call_user_func_array function in php
Function test ($ a, $ B)
{
Echo 'test 1: '. $ a. $ B;
}
// Call the test method. array ("asp", 'php') corresponds to the corresponding parameter.
Php scheduled task implementation code example
// Even if the Client is disconnected (such as closing the browser), the PHP script can continue to be executed.
Ignore_user_abort ();
// The execution time is
Example of using the header function in php
Header ("Location: http://bbs.it-home.org ";);
Exit; // add "exit" after each redirection to avoid errors and continue execution.
?>
2,
Some simple examples of php operations on xml files
/**
* Php operations on xml files
* Edit bbs.it-home.org
*/
// Example 1
$ Xml = simplexml_load_file ('example. XML'); // Create a
Summary of basic php knowledge for php beginners
It is suitable for beginners of php with some basic knowledge, but also some experience accumulation. if you have any need, refer.PHP BasicsI. PHPPHP is an embedded language mixed with HTML. 1
Php methods to prevent repeated definitions of constants
// Prevent repeated definitions of constants.
Defined ('II _ debug') or define ('II _ debug', true );
Defined ('II _ TRACE_LEVEL ') or
Example of phpswitch statement usage
/**
* Simple php switch example
* Edit bbs.it-home.org
*/
$ I = 1;
Switch ($ I ){
Case 0:
Echo "is equles 0 ";
Break;
Case 1:
PHP regular expression matching character method summary
This article introduces how to use regular expressions to match characters in php. if you need a friend, refer to the following.1. for a single character, it is usually represented
Introduction to regular expressions matching Chinese characters (GB2312utf-8)
This article describes how to match regular expressions (in GB2312 and UTF-8 formats) in Chinese. For more information, see.The following lists the delimiters
How does phpmyadmin occasionally respond to slow issues?
This article introduces that in the actual production environment, phpmyadmin occasionally responds quickly, resulting in a large number of edge connections in the wait status. This
Automatically identifies the browser language to switch between Chinese and English (php and Js)
Error_reporting (E_ALL ^ E_NOTICE );
// Analyze the HTTP_ACCEPT_LANGUAGE attributes
// Only set the first
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