Naming conventions
The Theta class file is named after the. class.php, which is called with the Hump method, and the first letter is capitalized, for example Pay.class.php;The Theta class name and directory _ file name are consistent. For example:
When the Windows Server opens the GD Library of PHP, the results of phpinfo () after using CGI do not appear in the Configure Command.
Find the php.ini file Extension=php_gd2.dll remove the front;
Also attached is how to detect if the GD library
Constructor usage
HP 5 Allowable developers define a method as a constructor in a class. Classes with constructors Call this method each time a new object is created, so it is ideal to do some initialization before working with the object.
Note:
That's probably what I did:
(1) Generate user authentication tokenAfter the user logs in I will generate a token that token may consist of the following information: Username+ip+expiration+salt "Just an example", then encrypt the composition
P> eyes without hate GBK Unicode UTF8 Kanji Conversion
The conversion of Chinese characters in PHP has always been a tricky business.
The class has four filters "[dec];", "& #x [hex];", "%u[hex]", "UTF8 conversion"
Easy to use, but also can
/*** Object* Base class*/Class Object{/* Whether to output debugging information * *var $debug = true; /*** Object* @deprecated method of destructor** @return void*/function Object (){Whether the user enters from the homepage, makes the judgmentif (!
Class HTML{var $dir; Dir for the htmls (without/)var $rootdir; Root of HTML files (without/): HTMLvar $name; HTML File Store pathvar $dirname; The specified folder namevar $url; Gets the source page address of the HTML file informationvar $time;
5. Other Miscellaneous5.1 Generating Images PHP can manipulate image processing. If you have installed the GD library, you can even use PHP to generate images.?Header ("Content-type:image/gif");$string=implode ($ARGV, "");$im = Imagecreatefromgif
PHP and AJAX imitation Live and Google search box
Ajax Live SearchIn the following example of Ajax, we will show the search for life, where the server gets the search results at the same time as the user type.Live Search has many benefits,
Work gap a class of file locks is written to solve some of the concurrency problems.
BOOL Flock (int handle, int operation [, int &wouldblock]);The handle of the flock () operation must be a file pointer that is already open. Operation can be one
PHP Magic Constants Detailed
Example:
Class moshu{public
function Moshu () {
echo ' current class name: '. __class__. "";
Echo ' Current method name: '. __function__. "";
Echo ' The number of rows in the current file: '. __line__. "";
Echo
Flex filesTeacherevalute.mxml
The code is as follows
Copy Code
Import Mx.utils.ObjectProxy;Import mx.rpc.events.ResultEvent;Import mx.controls.*;Import mx.events.*;Import Mx.controls.SWFLoader;Import
$ _ Files ["file"] ["name"]-name of the uploaded file$ _ Files ["file"] ["type"]-type of the file to be uploaded$ _ Files ["file"] ["size"]-size of the uploaded file, in bytes$ _ Files ["file"] ["tmp_name"]-name of the temporary copy of the file
The number format is the conversion format, starting from the percent sign ("%") to the end of the conversion character. The following possible format values:%-Percentage sign returned% B-binary number% C-characters based on ascii values% D-signed
Generating html principlesWe will write the tag to be generated into a template file, and then use php to read and replace the specified tag with the content we want to replace. Now the mainstream dedecms system does the same.Generate static page
For the apache environment, refer to the following solution.1. libmysql is missing in the system32 (C:/windows/system32) Directory of the system. dll file. The solution is to find libmysql in the php directory. dll, and libmysql. copy the dll to the
Official website: http://phpexcel.codeplex.com/The following describes the usage methods,Include 'phpexcel. Php ';Include 'phpexcel/Writer/excel2007.php ';// Or include 'phpexcel/Writer/excel5.php'; for output. XlsCreate an excel file$ ObjPHPExcel =
This script uses Curl to monitor the Nginx website Status. In response to the 502 message, restart LNMP. The code is as follows:Copy code #! /Bin/bashIfCurl-I http://www.111cn.net | grep "HTTP/1.1 502"ThenService php-fpm restart Fi adds the
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