Solution for phpob_flush not output every second
$ I = 3;
Ob_start ();
While ($ I --){
Echo $ I ,"";
Ob_flush ();
Flush ();
Sleep (1 );
}
Ob_end_clean ();
?>
Q:
In-depth understanding of the differences between ob_flush and flush in php
Ob_start ();
Echo '1 ';
Ob_flush (); // output php Cache and refresh
Echo '2 ';
Ob_flush (); // output php Cache and
How to enable zlibgzip compression configuration in PHP
Zlib. output_compression = Off
; Zlib. output_compression_level =-1
To:
Zlib. output_compression = On
Zlib.
How to set memory in php
Query_cache_size = 32 M
# The number of open tables for all threads. Increasing this value
# Increases the number of file descriptors that mysqld requires.
# Therefore you have
How to block php errors by configuring php. ini
This article introduces how to block php errors by configuring the php. ini file for your reference.Configure related content in the php configuration file php. ini to prevent related errors
Example code for calculating the number of visitors logging in using cookies in php
$ _ COOKIE ["counter"]? ($ C = $ _ COOKIE ["counter"] + 1) :( $ c = 1 );
SetCookie ("counter", $ c, time () + 60 );
Examples of _ get () and _ set Magic methods in php
// _ Set () is used to set private attributes.
Public function _ set ($ name, $ value ){
$ This-> $ name = $ value;
}
// _ Get () is used
Analysis on the principles of the PHP encryption function in the discuz program
// Parameter description
// $ String: plaintext or ciphertext
// $ Operation: DECODE indicates decryption, and others
Detailed description of php call time format parameters
$ D = date ("Y-m-d H: I: s ")
2. set "Y-m-d H: I: s" in the preceding syntax for time format parameters. the displayed format is year-month-day hour: minute: in
Php programming security knowledge
Register_global = off
Magic_quotes_gpc = off
Display_error = off
Log_error = on
# Allow_url_fopen = off
Expose_php = off
Open_basedir =
Safe_mode = on
Examples of php constants
Class Foo {
Const con_var = "The value of the constant attribute cannot be modified.";
Public function method_a (){
Echo (self: con_var );
}
}
A php function that converts xml into arrays.
/**
* Xml2array () will convert the given XML text to an array in the XML structure.
* Arguments: $ contents-The XML text
* $ Get_attributes-1 or 0.
: ++ I and I ++: 1. usage of ++ I (take a ++ I, i2 as an example) first, add the I value to 1 (that is, ii + 1) and then assign it to variable a (that is, ai). then, the final a value is equal to 3, and the I value is equal to 3. Therefore, a ++ I
Telnet mail: telnet mail to send emails to multiple addresses: & lt ;? PhpEmailClass0.5classforsendingmailPaulSchreiberphp@paulschreiber.compaulschreiber
//////////////////////////////////////// ////////////////////
// EmailClass 0.5
// Class for
: My Forum source code 5: okey. php mainly processes user login and publishing information & lt ;? If ($ username) has user information $ useinfo $ username. |. $ userpass; setcookie (FlyFoxNet, $ useinfo, time () + 3600); if ($ dq) setcookie
: Ob_start, ob_startob_gzhandler: use ob_start () whenever possible before output. this can speed up the output. it is applicable to NT for unix-type servers if ob_start (ob_gzhandler ); the output efficiency will be higher. use ob_start () whenever
: Analyze the output buffer in PHP: Let's take a look at the code: 0; $ I --) {echo $ I; flush (); sleep (1 );}? > According to the php manual, this function sends all the output of the program so far to the user's browser. The above code should
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