PHP has a lot of places to learn, here we mainly introduce PHP two-dimensional array assignment, let's start with a brief summary of PHP. For ordinary computer enthusiasts, PHP may be a strange name. More concerned about the network of friends, especially those concerned about the site building technology friends, may have heard of PHP. PHP is a simple but powerful programming language designed to dynamically create HTML content.
PHP itself is a simple and powerful language. The PHP language has core features such as powerful string and array processing capabilities, while greatly improving the support for object-oriented programming (PHP5 and above). By using standard and optional extensions, PHP applications can connect more than 10 databases such as MySQL or Oracle, draw, create PDF files, and create parsing XML files. You can also use the C language to write your own PHP extension module. For example, provide an interface function for PHP in a code base that already exists. You can also run PHP under Windows, use COM to control other Windows applications such as Word and Excel, or use ODBC to connect to a database. For a brief introduction to PHP, let's look at the knowledge of PHP's two-dimensional array assignment.
In the ASP
The number of records in the SQL statement query is total.
Assigning values through a while loop
- Namare (i,1) =rolename
But how do you implement PHP two-dimensional array assignment? In PHP, I define a two-dimensional array:
- $ Data_array =array ($total, 2);//The number of records where $datarows is the query
The specific loops are as follows: SQL statements ....
- $ I = 0 ;
- While ($result= $db->fetch_array ($query))
- {
- $ Area = $result ["area"];
- $data _array[$i][2]= $Area; Error!
- $ I = $i +1;
-
- }
http://www.bkjia.com/PHPjc/446520.html www.bkjia.com true http://www.bkjia.com/PHPjc/446520.html techarticle PHP has a lot of places to learn, here we mainly introduce PHP two-dimensional array assignment, let's start with a brief summary of PHP. For ordinary computer enthusiasts, PHP may be a ...