The following small series will bring you a PHP array traversal foreach syntax structure and example. I think this is quite good. now I will share it with you and give you a reference. Let's take a look at foreach ()
The PHP foreach () syntax
The following small series will bring you a PHP array traversal foreach syntax structure and example. I think this is quite good. now I will share it with you and give you a reference. Let's take a look at it with Xiaobian.
Foreach ()
The PHP
Source: http://www.cnblogs.com/keta/p/6117237.html
The foreach syntax structure is used to traverse an array. foreach ()
The PHP foreach () syntax structure is used to traverse an array of operations or output, and foreach () can only be used to
The foreach syntax structure is used to iterate through an array.foreach ()The PHP foreach () syntax structure is used to traverse an operation or an output array, and foreach () can only be used to iterate over an array or an object, resulting in
foreach ()
The PHP foreach () syntax structure is used to traverse an operation or an output array, and foreach () can only be used to iterate over an array or an object, resulting in an error when trying to use it for another data type or an
foreach ()
The PHP foreach () syntax structure is used to traverse an array of operations or output, and foreach () can only be used to traverse an array or object, and an error occurs when an attempt is made to use it for another data type or an
Smarty foreach Detailed description
For the knowledge of Smarty foreach, here is a detailed explanation of its function and usage.
Smarty {foreach} is used to iterate through an associative array like iterating over a numeric index array, unlike
The foreach basic syntax is as follows:
FOREACH ($array _variable as $value)
{
[Code to execute]
}
Or
FOREACH ($array _variable as $key => $value)
{
[Code to execute]
}
In both cases, multiple [code executions] will be executed equal to the number
The For loop is the most complex loop structure in PHP. Its behavior is similar to the C language. The syntax for the For loop is:
for (EXPR1; expr2; expr3) statement
The first expression (EXPR1) is evaluated unconditionally before the start of the
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.