I need to read several lines of content from a file, but the file is large. So I studied how PHP can read several lines of content from a large file and wrote a method,
Code As follows (with comments added ):
If the cached file can be saved in one
PHP header functions can be fewCodeYou can implement meta tags in HTML code.Here we only use the header function for page Jump.
1. page Jump code in HTML codeHTML Meta Refresh refresh and redirect pageRefresh property value-refresh and redirect
Php code:
Copy codeThe Code is as follows: Class Captcha_code
{
Var $ width = '60 ';
Var $ num = '4 ';
Var $ height = '20 ';
Var $ name = 'randcode ';
Public function _ construct ($ conf = "")
{
If ($ conf! = "")
{
Foreach ($ conf as $ key => $
File_get_contents of PHP obtains the remote page content. if the content is encoded using gzip, the returned string is garbled After encoding.
1. Solution: Find An ungzip function to convert it.
2. Add a prefix to your url to call
$ Content =
If you have installed xdebug, you can use xdebug_debug_zval () to display "zval" information. As follows:
Copy codeThe Code is as follows: $ Str = "jb51.net ";
Xdebug_debug_zval ('str ');
Result:
Str:(Refcount = 1, is_ref = 0 ),String 'jb51. net'
ODBC connection functionsOdbc_connect function: open an ODBC connectionOdbc_close function: closes an open ODBC connection.Odbc_close_all function: Close all open ODBC connectionsOdbc_pconnect function: open a continuously valid ODBC connection
ODBC
The ob_start () function is used to open the buffer. For example, if there is output before the header () function, including carriage return, space, line feed, and "Header had all ready send by" errors, in this case, you can use ob_start () to open
Mb_convert_encoding is used to convert the encoding. I have never understood the concept of program encoding, but now it seems a bit open.
However, the English language generally does not have Encoding Problems. Only Chinese data can have this
Here I want to summarize some information about the path where the URL and file in the address bar belong to me:With $ _ SERVER [], we can accomplish many things: it is an array containing headers, path information, and script positions. The array
Every time a large file is uploaded on The page, The FastCgi error occurs: "The FastCGI process exceeded configured request timeout". After several experiments, I understand that The configuration file "fcgiext" of FastCgi needs to be modified. ini
Sometimes variable names bring great convenience to programming. That is to say, the variable name can be dynamically named and used. Generally, variables are named using the following statement:
$ A = 'hello ';A variable name uses the value of a
Copy codeThe Code is as follows: /**
* A common tree class can generate any tree structure
*/
Class tree
{
/**
* The two-dimensional array required to generate a Tree Structure
* @ Var array
*/
Var $ arr = array ();
/*** The modifier required to
Code
Copy codeThe Code is as follows: // obtain the start time and end time of the week of the specified date.
Function getWeekRange ($ date ){
$ Ret = array ();
$ Timestamp = strtotime ($ date );
$ W = strftime ('% U', $ timestamp );
$ Ret ['sdate']
1. const is used for defining class member variables. Once defined, the value cannot be changed. Define defines global constants that can be accessed anywhere.
2. define cannot be defined in the class, But const can.
3. const cannot define
There are two ways to change the image size.(1): The ImageCopyResized () function is valid in all GD versions, but its algorithm for scaling images is rough.(2): ImageCopyResampled (), the edge of the image obtained by the pixel interpolation
1: pre-definedIn the home directory, you can also write a file in any other directory, such as caleng_module.def.The content is the name and parameters of the function you want to define:Int a (int x, int y)String B (string str, int n)
2: Go to the
Advantages and disadvantages of using C/C ++ to expand PHP:Advantages:Efficiency or efficiencyReduce the complexity of PHP scripts. In extreme cases, you only need to simply call an extended function in the PHP script, and then all your functions
1. preg_match-execute a regular expression to matchInt preg_match (string $ pattern, string $ subject [, array & $ matches [, int $ flags = 0 [, int $ offset = 0])
Search for a match between the regular expression specified by subject and
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