$_server stores the current server information, with several values such as
The code is as follows
Copy Code
$_server["Query_string"],$_server["Request_uri"],$_server["Script_name"],$_server["Php_self"]
Often
The code is as follows
Copy Code
CREATE TABLE ' Tb_user ' (' ID ' int (a) not NULL auto_increment,' username ' varchar not NULL,PRIMARY KEY (' id ')) Engine=myisam DEFAULT Charset=utf8 auto_increment=10;INSERT into ' Tb_user ' VALUES
POST data to a page using PHP
The code is as follows
Copy Code
function Socketpost ($url, $data, & $ret){$URLARR = Parse_url ($url);$host = $URLARR [' Host '];$port = Isset ($urlArr [' Port ']) $URLARR [' Port ']:80;$path
That's the easiest thing to do.
The code is as follows
Copy Code
Header ("Content-type:application/vnd.ms-excel");Header ("Content-disposition:attachment;filename=test_data.xls");$tx = ' table Head ';echo $tx. " nn ";The
Objective
Directly on the code is a bit unkind, so in accordance with the celestial tradition, the entire paragraph described .... (I have a limited ability to express my language, and we can endure it.)
function
Used when registering users on a
Involved in the textarea, because the content is Base64 encoded after the result (specification, base64 encoding results of every 76 characters need to add a carriage return line, that is, a ""), in IE under test, all OK, but to the Firefox and
Many download files on websites now provide statistical functions. This article describes how to use php to implement this function. Programmers who want to hide the download file path and avoid using the url to download files directly, this article
The code is as follows:Copy code $ String = "this is the URL in the php extract text content string, connected as a http://www.111cn.net site ";// A space or carriage return is required after the connection.$ String = eregi_replace ("http: // ([^,
Example 1 obtain all the images in the string$ Str = ' ';$ Pattern = "/ /";Preg_match_all ($ pattern, $ str, $ match );Print_r ($ match );?>Result:Array([0] => Array([0] => )[1] => Array([0] => upfiles/2009/07/1246430143_1.jpg))Example 2: This
During local debugging today, a cookie cannot be written into the system. The environment is as follows:Domain name: 111cn.netBrowser: chrome34Code: The code is as follows:Copy code Header ("Content-type: text/html; charset = utf-8 ");If (isset (
Because isset belongs to the language structure in php, and array_key_exists is a function, isset is faster. In addition, isset also exists in other languages and is more readable.I am confused. What is isset actually not a function? As for the
Implementation method:1. Directly use the file function.Note: The file function reads all the content into the memory at a time. To prevent some poorly written programs from occupying too much memory, php causes insufficient system memory and server
PHP mysql_data_seek () function tutorialDefinition and usageThe mysql_data_seek () function moves the internal row pointer.Consecutive internal pointers are the mysql_query () functions currently ranked in the returned results.This function returns
1. Value assignment: Copy the value of the value assignment expression to the variable. Example: The code is as follows:Copy code $ Number = 15;$ Age = 20;$ Sum = 12 + "15"; // $ sum = 27 2. There are two ways to create an array: variable
Some websites usually return JSON-format data when using ajax:Php output JSON formatObviously not what you want. Or a string. How do I implement it? In fact, it is very easy to add the following code to the PHP file header: The code is as
The code is as follows:Copy code Function Pinyin ($ _ String, $ _ Code = 'utf8') {// The GBK page can be changed to gb2312.$ _ DataKey = "a | ai | an | ang | ao | ba | bai | ban | bang | bao | bei | ben | beng | bi | bian | biao | bie | bin |
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