PHP Database configuration file Implementation Method Example

$db _name= "Test"; $db _username= "root"; Global $db _password; ?> Copy Code2, Database operation class (call config file) db.fun.php: Require ("config/config.php"); Class db{

PHP Data Bulk Import CSV file (example)

/**php Importing a CSV file to a database * * * * Simultaneous calculation of program execution time ***/ Defining the Get Time function function Getmicrotime () { List ($usec, $sec) = Explode ("", Microtime ()); return

PHP implementation code to send mail using SMTP

For everyone to give a PHP use SMTP to send mail code, simple and practical, the need for friends, you can refer to the next. The complete code is as follows. ' Scripting School ',//fill in the name of the website here); $mail = Array (' state

Modify PHP Upload file size limit (Windows, Linux)

Introduced under the revised PHP upload file size limit method, sub-Windows and Linux two environments, respectively, introduced the next PHP upload limit solution, the need for a friend reference.This section: Modify the PHP upload file size limit,

PHP Bubble sorting algorithm implementation code

!--? php //bubble sort function //This function uses references to avoid memory consumption //collation: bbs.it-home.org functi On &bubble (& $arr) { $count =count ($arr); if ($count

PHP Server configuration Process Resolution

This article describes the next PHP server configuration method, PHP environment to build the specific steps, with the need for a friend reference.This section: PHP server Configuration method, PHP environment setup steps.The steps are as follows: 1,

PHP page Encoding declaration method header or Meta code

Header ("content-type:text/html; Charset=utf-8 "); Copy CodePHP page is GBK encoded Header ("content-type:text/html; charset=gb2312 "); Copy CodePHP page is BIG5 encoded

PHP Split Array Example

$arr =explode ("|", $array [' AA ']); Split array $num = @count ($arr); Get the number of arrays for ($i =0; $i echo $arr [$i]; } Copy Code>>> you may be interested in the article: PHP array splitting

PHP Server Environment configuration (Apache and IIS two methods)

Default_charset= "gb2312", modify the default character set, here, if preceded by a semicolon ";", remove the semicolon; The Register_globals=off is changed to Register_globals=on, making the transitive global variable valid; Extension=

PHP Chinese Character coding conversion method explaining

This paper introduces some knowledge of Chinese character coding conversion in PHP, analyzes the principle and method of PHP code conversion, and has the need of a friend reference.For an understanding of the mysql4.1 character set, tell how PHP

PHP character encoding conversion problem

$string =mb_convert_encoding ($string, character output encoding, original character encoding); Copy CodeFor example: Web pages use GBK encoding, strings are encoded using UTF-8, and characters are converted to Web page display

PHP import csv to MySQL database

Copy Code2, Execution page insertdb.php Session_Start (); Header ("Content-type:text/html;charset:utf-8"); Global variables $file =$_files[' filename '; $max _size= "2000000"; Maximum file limit

Unicode encoding and decoding of Chinese characters in PHP

Encode content in Unicode, encoded content format: yoka\u738b (original: Yoka Wang) function Unicode_encode ($name) { $name = Iconv (' utf-8 ', ' ucs-2 ', $name); $len = strlen ($name); $str = "; for ($i = 0; $i {

PHP Recursive sample PHP recursive function code

Get the role ID string recursively function Exploderole ($ROLEOBJ, & $resultStr) { if (0 childroleobjarr)) { foreach ($roleObj->childroleobjarr as $CHILDROLEOBJ) { if (' = = ' $resultStr) { $resultStr. = "{$childRoleObj->id}"

CodeIgniter Image Processing Class code

!--? php define ("BasePath ", DirName (__file__). ' /'); function &get_instance (& $class _object) { return $class _object; } function Log_message () {} //Image

PHP get remote picture size function Example

Usage echo remote_filesize ($url, $user = ", $PW ="); $url = "http://www.aa.com/librarys/images/random/rand_11.jpg";//Picture address Echo remote_filesize ($url, $user = ", $PW ="); function Remote_filesize ($uri, $user = ", $PW =")

htaccess file to set password protection for the site folder

AuthType Basic AuthName "Restricted area" authuserfile/full/path/to/passwordprotected/.htpasswd Require Valid-user Copy CodeThe first line of AuthType refers to the use of the authentication method, where we

PHP probe phpinfo () function disabled when used

Header ("content-type:text/html; Charset=utf-8 "); Header ("Cache-control:no-cache, must-revalidate"); Header ("Pragma:no-cache"); error_reporting (0); Ob_end_flush (); ?>

PHP download get remote picture function (can forge route)

Download get remote Pictures function Downimagekeep ($gurl, $rfurl, $filename, $gcookie = "", $JumpCount =0, $maxtime =30) { $urlinfos = GetHostInfo ($gurl); $ghost = Trim ($urlinfos [' Host ']); if ($ghost = = ") {

PHP Server Configuration (Php+mysql+iis) steps

This article introduced the PHP server configuration detailed steps, the environment for Php+mysql+iis, grasp the PHP environment to build the method, the need for a friend reference.This section: How to build a PHP server environment.Software

Total Pages: 5208 1 .... 1741 1742 1743 1744 1745 .... 5208 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.