To access the database steps:1. Create a Connection object 1 $db = new mysqli ("localhost", "root", "123", "MyDB");2. Determine if the connection is wrong 1 ! Mysqli_connect_error () or die ("Connection failed! ");3. Write SQL statements 1 $sql =
Start using PHP to write the background service for a while. Also under such a drive, constantly learning PHP grammar, experience this has always been thought to be mysterious and the charm of the Magic language at a distance. Initially looking at
In the previous chapters of this tutorial, we already know that an array is a simple list of number/value pairs.However, there are times when you want to store values with more than one key.Can be stored in multidimensional
Array operators
Array operators
Example
name
Results
$a + $b
Joint
The Union of $a and $b.
$a = = $b
Equal
TRUE if $a and $b have the same key/value pair.
PHP Array SortingThe elements in the array can be sorted in ascending or descending order, either in alphabetical or numerical sequence.PHP-sorting functions for arraysIn this section, we will learn the following PHP array sorting functions:
/** * Sort by the key values of the two-dimensional array * @param unknown $array two-dimensional array * @param unknown $key The key value of the two-dimensional array * @param string $order Ascending /descending * @return Multitype:unknown returns
1chuli.phpPHP//All information about the uploaded file is saved in $_files["file"; inside the arrayEcho $_files["File"] ["Name"];//Take file nameEcho $_files["File"] ["type"];//Fetch file TypeEcho $_files["File"] ["Size"];//fetch File SizeEcho
While a loop executes a code block as long as the specified condition is trueDo...while executes the code block first, and then repeats the loop when the specified condition is set.The number of times the for Loop executes the code block
Regular expressionsSlash stands for delimiter/^$//*$str = "abcde123fg456h";$reg = "/\d/";Echo preg_replace ($reg, "#", $str);//replace the string str with the regular expression Reg #Var_dump (Preg_split ($reg, $str)); Splitting a string str by
Register chuli.php//do not have an empty top to write$type=$_post["Type"];include"Dbda.php";$db=NewDbda ();Switch(){ Case0:$uid=$_post["U"];//Receive$pwd=$_post["P"];$sql= "SELECT count (*) from login where Username= ' {$uid} ' and password= ' {$pwd}
Defines the array length variable $len, using the count () function, parameter: arrayFor loop Array, condition: From the second start, iterate through the array, inside the loopDefine temporary variable $temp, assign current elementFor loop Array,
AreaCode AreaName Parentareacode three-level linkage Sanji.jsAjax synchronization, which means that when Ajax processes data, it must wait until processing is complete to execute the statement,Ajax asynchronous, asynchronous refers to when the AJAX
Recently in learning PHP, this machine installed test environment, my native is Win10 64-bit, for convenience, recommended useWampserver, it integrates Apache, MySQL, PHP, all done at once. The wampserver 2.5 64-bit integrates:apache:2.4.9mysql:5.6.1
Preparatory work1. Download PHP http://windows.php.net/download/Select non-thread safe2. Download and install the Microsoft Visual C + + Redistributable Package (IA64)https://www.microsoft.com/zh-cn/download/details.aspx?id=2054Start installation1.
PHP framework performance test report and php framework performance test
As a PHP developer and a technical developer of the startup team, it is very difficult to select a development framework.
If ThinkPHP is used, you can get started by recruiting
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