<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档 </title>
</head>
<body> <form name="form1" method="post" action="">
<?php for($i=0;$i<10;$i++)
{ ?>
<p id="x">df</p>
<?php } ?>
</form></body>
我现在想用一个循环生成10个p标签,但我又同时想让它自动生成它的id号。这个怎么作啊。
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档 </title>
</head>
<body> <form name="form1" method="post" action="">
<?php for($i=0;$i<10;$i++)
{ ?>
<p id="x">df</p>
<?php } ?>
</form></body>
我现在想用一个循环生成10个p标签,但我又同时想让它自动生成它的id号。这个怎么作啊。
<?php for($i=0;$i <10;$i++)
{ ?>
<p id=" <?php echo $i; ?>">df </p>
<?php } ?>
</form> </body>
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html