Home > php教程 > php手册 > PHP快速入门教程之for循环

PHP快速入门教程之for循环

WBOY
Release: 2016-06-13 10:33:42
Original
1351 people have browsed it

 <html>

<head>

<title>for循环示例</title>
<meta http-equiv=content-type content="text/html; charset=gb2312">

</head>

<body>

<h2 align=center >客户端的信息-FOR循环</h2>

<hr color=red>

<!--PHP程序的开始-->

<?

echo"<table border=1> ";//显示表格的边框

/******************************
用for循环来读取$GLOBALS数组的值
在循环体中显示出客户端的信息
*******************************/

for ($key=reset($GLOBALS);$key=key($GLOBALS);$key=next($GLOBALS))
{
$value=pos($GLOBALS);
echo "<tr><td>$key</td><td>$value</td></tr> ";
}

echo "</table> ";

?>

<!--PHP程序的结束-->

</body>

</html>

Trackback: aspx?PostId=1423202">http://tb.blog.csdn.net/TrackBack.aspx?PostId=1423202

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template