Method One:
? PHP
$str = uniqid (Mt_rand (), 1);
Echo ' SHA1: ', SHA1 ($STR);
Echo ' ';
Echo ' MD5: ', MD5 ($STR);
Using Uniqid function, with Mt_rand random function, finally using hash is worth the final unique value.
But in the test, the
Using PHP in three simple ways to achieve the mobile phone number of the middle four (n-bit) with an asterisk display:
$mobile = ' 13912345678 ';1. String interception method$newMobile 1 = substr ($mobile, 0, 5). ' '. substr ($mobile, 9);echo
Bloggers have recently begun to learn about the various design patterns of PHP. In the beginning, of course, from some simple design patterns began to learn, such as the previously published factory model, today's simple mode, and then to see the
A relatively simple php file Upload example, can be used when the request is not high, recorded here, convenient later to use when directly over the copy.
$resume = $_files[' Resumefile '];if ($resume [' name ']!= '){$enableType = array (' jpg ', '
Use PHP's unique array_map function to traverse the edges of all strings in the array to clear the space
The code is as follows
Copy Code
function Trimarray ($Input) { if (!is_array ($Input))Return trim ($Input);
Question mark comma operator syntax
The code is as follows
Copy Code
$a = 1;$b = $a ==1? ' A ': ' B ';echo $a;Result outputA
Parse the above statement into if else
The code is as follows
Copy
The way to open SSL in PHP is very simple, first find the php.ini file, the extension=php_openssl.dll before the annotation symbol ";" Remove, and then restart Apache to take effect!
Some friends do this but found that SSL is not effective, then
Here are a few ways to jump:
One of the most common methods on the Web:
The code is as follows
Copy Code
$url = $_get[' url '];Header ("Location: $url");?>
Put this code in a folder, named for example go.php
PHP error hint "Undefined variable": variable undefined, if you block the notice level in php.ini settings then he will not show any prompts, but for the sake of the rigor of the program, we try to avoid any warning, Errors, and other obvious
Share a method to meet these two conditions at the same time, not only to facilitate the Web site program error debugging, but also does not affect the normal operation of the site debugging methods. Copy the following PHP statement to the top of
This article is about CentOS, for example, the Red Hat series of Linux methods should be so, the following detailed steps, here seriously despise what content?? Long ⑺ file brain leisurely 咴 Shadow said PDO compile installation article.
1, into the
PHP Tutorial Design mode builder mode and adapter (adapter mode)
Adapter mode** Convert the interface of a class to another interface that the customer expects, and those classes that are not compatible to work together can work together
Builder
Bitwise operators
Bitwise operators allow placement of the bits specified in the integer number. If both the left and right arguments are strings, the bitwise operator will manipulate the ASCII value of the character.
Do not move more than 32 bits
PHP Tutorial Scandir traversal display all files and folders under the file, the method is very simple we only use the Is_dir to determine the recursive lookup once, so you can traverse the directory all the files.
Directory traversal
IMAP connection server code.
Connect an IMAP server link with an IMAP port of 143.$mbox = Imap_open ("{Localhost:143}inbox", "user_id", "password");Connection POP3 Server link, POP3 port is 110.$mbox = Imap_open ("{Localhost/pop3:110}inbox",
PHP and AJAX Responsexml Instance tutorial
Ajax technology can be used to recover the database information for XML.Ajax database for example of XMLIn the following example of Ajax, we will demonstrate how Web pages can be sold to information
Example The code is as follows:Copy code Function send_mail ($ from, $ to, $ subject, $ message){If ($ from = "") {$ From = 'future memories '; // sender address }$ Headers = 'Mime-Version: 100'. "rn ";$ Headers. = 'content-type:
The ftp_connect () function creates a new ftp connection.If the connection succeeds, a connection id is returned. Otherwise, false is returned.SyntaxFtp_connect (host, port, timeout)*/$ File = 'public _ html/index. php tutorial '; // define a file$
*/$ Hash_list = hash_algos (); // return the registered hash rule listPrint_r ($ hash_list); // display the result/* Create a file to calculate the hash value */File_put_contents('example.txt ', 'The quick brown fox jumped over the lazy dog .');/*
1. Configure nginx1. Start the nginx service.The command is as follows:[Root @ VM_185_51/] # service nginx restart2. Test whether the nginx service is running normally.If 'index.html 'saved is displayed at the end, the nginx service is normal.[Root @
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