When we operate the database, we need to use theLet's look at an array traversal of a basic number format:
- Php
- $temp [0] = "Richmond";
- $temp [1] = "tigers";
- $temp [2] = "premiers";
- For ($x=0; $x<Count ($temp); $x + + )
- {
- echo $temp [$x];
- echo "";
- }
- ?>
Another way to save more code, however, is:
- Php
- $ Temp Array("Richmond", "tigers", "premiers");
- foreach ($temp as $element)
- echo "$element";
- ?>
foreach can also output text subscript:
- !--? php
- $ temp = array ("club" = ; " Richmond ",
- " nickname "= ; "Tigers",
- "aim" = ; "premiers");
-
- foreach ($temp as $ key = ; $value)
- echo "$key: $value";
- "
This is the relevant use of the PHP associative array in the database.
http://www.bkjia.com/PHPjc/446373.html www.bkjia.com true http://www.bkjia.com/PHPjc/446373.html techarticle when we operate the database, we need to use the following we look at a basic number format array traversal: PHP $temp [0]= "Richmond", $temp [1]= "tigers"; $temp [2]= "premiers"; for ...