Php code optimization tips (36 php optimization tips)
This article introduces some php code optimization techniques. if you need them, you can refer to them.1. if a method can be static, it is declared as static, and the speed can be
One PHP interview question-it is said that it was from a large company
$ Arr1 = array (
'0' => array ('fid' => 1, 'tid' => 1, 'name' => 'name1 '),
'1' => array ('fid' => 1, 'tid' => 2, 'name' => 'name2 '),
'2'
Php programmer interview questions (Sina)
This article introduces a php programmer interview question from Sina. if you have any questions, refer to it.1. write a function, as efficient as possible, to retrieve the file extension from a
PHP Cookie does not refresh the implementation code that takes effect immediately
/**
* Do not refresh the cookie to take effect immediately
* Site http://bbs.it-home.org
*/
Cookie ("mycookie",
Php image operations (image watermarking)
We provide you with a php image Operation class, which can be used to add watermarks to images. For more information, see.Complete Image operation code.
ChangeSize (80, 50); // change the size $
A php mysql operation class
// Database operations
Class db
{
// Save the data variable after SQL execution;
Var $ db;
// Read or set the current data location
Var $ position = 0;
How to select a suitable Web development framework for your project?
How to select a suitable web development framework for your project? First of all, for a software development start-up company, this is more like a business choice than
Php code for extracting Zip files
/**********************
* @ File-path to zip file
* @ Destination-destination directory for unzipped files
*/
Function unzip_file ($ file, $ destination ){
//
Php methods for retrieving http request header information php methods for obtaining http request header information
$value) {echo "$name: $value\n";}?>
This function can only be used in an apache environment. it is not supported by iis or nginx
Code for converting a php multi-dimensional array to a string or a multi-dimensional array to a one-dimensional array
/**
* @ Method multi-dimensional array to string
* @ Staticvar array $
Example of using CI to operate multiple databases
Function _ construct ()
{
Parent: :__ construct ();
$ This-> xx = $ this-> load-> database ('XX', TRUE );
$ This-> load->
Several methods for obtaining php time
Function getWeekName ($ data, $ format = 'week ')
{
$ Week = date ("D", $ data );
Switch ($ week)
{
Case "Mon ":
$ Current = $ format. "1 ";
Php sets the index. php file to read-only
Function set_writeable ($ file_name)
{
If (@ chmod ($ file_name, 0555 ))
{
Echo "the read-only attribute of the index. php file has been modified ";
}
How to convert data to scientific count when exporting data to excel
// In the excel. php file
$ ObjActSheet = $ objPHPExcel-> getActiveSheet ();
// Set the topic name
$ ObjActSheet-> setCellValue ("b1",
How to Set cache and obtain cache instances in js
Example: set and obtain cache in js.
// Set the cache, get the set cache, key-value pair form, name value
LocalStorage. getItem ("key"); // Obtain the key value
Discuz classic sitemap map, no graph version shows the first 100 stickers
Demo address: http://bbs.it-home.org/sitemap.phpInstallation method: Upload sitemap. php in the attachment to the site root directory, and then access your domain
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