$array =array (' Step One ', ' Step ', ' step three ', ' step Four '); Define an array
Echo current ($array). "
n "; Returns the first element of an array
Next ($array); The array pointer moves back one
Next ($array); The array pointer moves back one
Echo current ($array). "
n "; Returns the current element of the array, the third value
Reset ($array); The pointer points to the first value of the array
Echo current ($array). "
n "; Returns the first value of an array
//
$info =array (' Red ', ' blue ', ' green '); Defining arrays
while ($result =current ($info))
{
echo $result;
echo "
";
Next ($info);
}
//
$array =array (
' Fruit1 ' = ' apple ',
' Fruit2 ' = ' orange ',
' fruit3 ' = ' grape ',
' Fruit4 ' = ' apple ',
' Fruit5 ' = ' apple '); Defining arrays
while ($fruit _name=current ($array))//loop Gets the current value of the array
{
if ($fruit _name== ' apple ')//If the current value is Apple
{
echo Key ($array). '
'; The key name of the output current value
}
Next ($array); Move the array pointer down one step
}
http://www.bkjia.com/PHPjc/445391.html www.bkjia.com true http://www.bkjia.com/PHPjc/445391.html techarticle $array =array (step one,step two,step three,step four);//defines an array of echo current ($array). n;//returns the first element of the array next ($array); The array pointer moves back one next ($array) ...