We are learningFor 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
- Dim namare ()//define Array
The number of records in the SQL statement query is total.
- ReDim Namare (total,2)//redefine array, where total is the number of records that the query gets
Assigning values through a while loop
- Namare (i,1) =rolename
- Namare (i,2) =area
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
- $data _array[$i][2]= $Area;//Hint error: Cannot use a scalar value as an array
The specific loops are as follows: SQL statements ...
- $ I = 0
- While ($result= $db->
- { $area
- $data _array[$i][2]= $Area; Error!
- $ I = $i +1;
- }
http://www.bkjia.com/PHPjc/446359.html www.bkjia.com true http://www.bkjia.com/PHPjc/446359.html techarticle We are learning for ordinary computer enthusiasts, PHP may be a strange name. More concerned about the network of friends, especially those concerned about website construction Technology Friends, may have heard of ph ...