In general, set the time when PHP script execution times out
One, in the php.ini inside set
max_execution_time = 1800;Second, through the PHP ini_set function set
Ini_set ("Max_execution_time", "1800");Third, through the Set_time_limit function set
Strip_tagsRemove the HTML and PHP tags.
Syntax: string strip_tags (String str);
return value: String
Function type: Data processing
Content Description
This function removes any HTML and PHP tag strings contained in the string. If the string of HTML
Have analyzed the source of strtr before, now compare Strtr, str_replace and preg_replace efficiency:
Copy CodeThe code is as follows:
$str =
' 111111110000000000000000000000000000000111000001000100010000010010000010010000010100000010
';
$str = Str_
Recently, the need to meet the test requirements, the Big data concurrency test, reported "HTTP error 500.0-internal Server error E:\PHP\php-cgi.exe-FastCGI process exceeded the configured activity timeout period"
Workaround:
iis7->fastcgi
PHP files in garbled (such as a.php files in the browser garbled):The header ("Content-type:text/html;charset=utf-8") is the setting page.
mysql_query ("Set names Utf-8") sets the database.
Struts in Java:Chinese garbled problem generally refers to
"Verbose error": This operation could not be completed because of an error c00ce56e
Cause : The output encoding format is not specified.
"solution": the first sentence added to the header ("content-type:text/html; Charset=utf-8 ");
1. You can use {$array | count} to try it.2.
Copy CodeThe code is as follows:
{foreach from= $variable key=key name=name Iteam=value}
{$variable | @count}//Get array length
{$smarty. Foreach.loop.index}//Gets the current loop array element subscript,
If it is under Linux, first confirm whether to add Ob_start () and Ob_flush ().
Copy CodeThe code is as follows:
Ob_start ();
for ($i =1; $i echo $i. "
\ n ";
Ob_flush ();
Flush ();
Usleep (500000);
}
If you still can't output it, just precede the
The PHP session of the Web server is given to memcached, so you don't have a problem with which Web server the Distributor distributes IP connections to, and the configuration is simple, in the PHP configuration file
Add a statement on it, but if
As we all know, there are many ways to delete array elements in PHP, and the functions used frequently are PHP array_unique (). So the PHP function Array_flip () We're going to introduce to you today is about 5 times times more efficient than the
Don't say much nonsense, just go to the code!
Copy CodeThe code is as follows:
Class Macaddr{Public $returnArray = Array ();Public $macAddr;function __contruct ($os _type=null) {if (Is_null ($os _type)) $os _type = Php_os;Switch (Strtolower ($os
What is the user agentThe user agent Chinese name is called "UA", which is a special string header that allows the server to identify the operating system and version, CPU type, browser and version, browser rendering engine, browser language,
Copy CodeThe code is as follows:
$key = $_get[' key ']; Get keywords
$select = $_get[' select ']; Get the Search engine choice
Switch ($select)//jump to a different page depending on the search engine
{
Case "Google"://google
$url =
Curl Status Code List
Status code
Status Reason
Explain
0
Normal access
1
The wrong protocol
An unsupported protocol. This version of Curl does not support this protocol.
2
Copy CodeThe code is as follows:
//PKI EncryptionUsing PKI encryption requires the OpenSSL extension to be turned on
php.ini extension = Php_openssl.dll extension
/*pki mode is
* Public key encryption, private key decryption;
* Private key
Need to read a few lines of a file, but the file is relatively large, so the next PHP read a few lines of the content of the method, wrote a method, the code is as follows (annotated):
If the cache file can be saved on a single line, and the
There are two main ways to handle MySQL transactions.1, with Begin,rollback,commit to achieveBegin a transaction
ROLLBACK TRANSACTION Rollback
Commit TRANSACTION Acknowledgement
2, directly with set to change the MySQL automatic submission
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