Php program used to generate random user names in batches
/* Extract random values from dictionary files */
$ File1 = "./Words. dic ";
$ File2 = "./common_pass_mini.dic ";
$ File3 = "./Sys_Month_
PHP obtains the code of the current website and domain name
Echo SERVER ['server _ name']; // Obtain the source URL, that is, click the previous URL on this page.
Echo SERVER ["HTTP_REFERER"];
Alternative application of phpmd5 encryption
// Iterative algorithm
Function md5_1_1 ($ data, $ times = 32)
{
// Use MD5 repeatedly
For ($ I = 0; $ I
$ Data = md5 ($ data );
}
Example of php sending download of various types of files using headers
Header ('content-type: application/image/pjpeg '); // output type
Header ('content-Disposition: attachment; filename = "downloaded.jpg" ');
Example of a php database call class
/**
Desc: Database Class call instance suppose your data Class is db_class.php
Link: bbs.it-home.org
Date:
*/
Require_once ("db_class.php ");
/
Ftp file Upload class written in php
/**
* Desc: FTP class
* Link: bbs.it-home.org
* Date:
*/
Class ftp
{
Public $ off; // return the operation status (successful/failed)
Implementation of google, bing, and youdao translation
Google translation is implemented by capturing the results of Web translation.Bing translation calls its API to correct errors in the official sample code.Youdao translation calls
Php method for searching specific values in multi-dimensional arrays
Public function searchArray ($ array, $ key, $ value ){
Foreach ($ array as $ keyp => $ valuep ){
If ($ valuep [$ key] ==$ value ){
Small example of removing duplicates from php arrays
Function assoc_unique ($ arr, $ key ){
$ Tmp_arr = array ();
Foreach ($ arr as $ k =>$ v ){
If (in_array ($ v [$ key], $ tmp_arr )){
Unset ($
Differences between include () and require () in php
1. include has a return value, but require does not. 2. include () includes and runs the specified file. when the processing fails, include () generates a warning. the imported program
Template engine of Discuz
The template engine of Discuz is a good template engine class. it was found on the Internet a long time ago. the template engine of Discuz should have been very old, and it was a version earlier than DZ7.2, I am
Php object-oriented basics
Class Person
{
// The following are the member attributes of a person.
Var $ name; // name of a person
Var $ ***; // gender of a person
Var $ age; // age of a
Example of using mysql database to store session in php
Create table 'DB _ session '(
'Sskey' char (32) not null,
'Expiry' int (11) unsigned not null,
'Value' text not null,
Primary key ('sskey ')
)
Jquery (Jcrop) + PHP cut images by coordinate
/*** Goofy 2011-11-29 * Image Processing: based on the passed coordinate parameters, x, y, w, and h are the selected x coordinates, y coordinates, w width, h height * use the imagecopy () method
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