/*Php uses ISO-8859-1 to process strings, that is, to process strings in a single byte. The Chinese code is a multi-byte character. When substr is used,Strlen, str_peplace, and other functions are prone to errors. Special Chinese operations must
(1) mysql_connect (host, user name, password );Returns a connection number.Note: The passwords of mysql users can change with the IP address of the user's machine.In addition, mSQL does not have a user name mechanism, so msql_connect only needs one
PHP can open Socket ports on a remote or local host. This article is a small example of using Socket: ConnectionConnect to a Usenet newsgroup server, talk to the server, and download some articles from the newsgroup.Open a socket in phpUse fsockopen
$ Message = ... A bunch of strings, such as batch HTML code, can be read.EOD;Load to $ message.$ To = "digico@123.com ";$ Mail = "hts@123.com ";$ Zhui= "I Love You"; // subject// $ Mailheaders. = "Content-Type = text/html; charset = gb2312 ";// $
Php converts text files to csv files
Php converts text files to csv filesThis class provides a quick and easy way to convert a CSV file to a fixed width. It can use SplFileObject to execute iterations so that an iteration that is very efficient only
Php fgets Function
Fgets(PHP 4 and PHP 5)Fgets-get the pointer to the line slave FileDescriptionString fgets (resource $ processing [summary $ length])Get the line from file pointer.ParametersHandleThe file pointer must be valid and must point to a
For some reason, the allow_url_fopen option of php is disabled, that is, file_get_contents cannot be directly used to obtain the content of the remote web page. That is, you can use another function curl.
Unlimited file_get_contents function for
The most common way to compare the two strings is to use "=" to determine whether they are equal. As for the difference between it and "=, simply put, the former emphasizes that the "identical" type also requires the same; the latter requires
Definition and usageMysql tutorial _ field_type() Specifies the field type in the returned result set of the function.
If the operation succeeds, the type of the specified field is returned. If the operation fails, false is returned.
In the fourth phase of the PHP built-in Function Research Series, The parse_str function is used to parse the query string to the variable. This article mainly discusses the functions and usage of the parse_str () function.
The parse_str () function
Use php and imagemagick to process upload and zoom of image filesPhp is very easy to process file uploads. However, if you want to scale the uploaded image, you can use GD,Complicated processing is required. ImageMagick is an image processing
Application InstanceThe POP3 mail receiving class has already been described in detail in the previous article. Let's take a look at how to apply this class: Include ("pop3.inc. php ");$ Host = "pop.china.com ";$ User = "boss_ch ";$ Pass = "026007
If (eregi ("^ [_. 0-9a-z-] + @ ([0-9a-z] [0-9a-z-] +.) + [a-z] $", $ email )){Echo "your email has passed the preliminary check ";}?>In this sentence, an eregi function is first applied, which is quite understandable. If you look for a book, you can
Grasp pear: BenchMark. Now you know how to test your code and how to determine which part of your code is slow. Next I will talk about how to eliminate or optimize the slow code.In this regard, my main experience is only two points. One is to
Define ("tblPath ",".");Define ("exten", ". php ");Define ("fileHead", " This file only for class txtTbl ");Class txtTbl {Var $ innerName = ""; // Database NameVar $ innerCount; // number of database recordsVar $ innerFields; // database Field List
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