php数组与基本循环
<?php$myName="xixi";$names=array('xixi1','xixi2','xixi3');
?>
<p>
Hi ,my name is
<?php echo $myName; ?>
</p>
<p>
Hi,my name is
<?php echo $names[0] ?>
</p>
<p>
Hi,my name is
<?php echo $names[1] ?>
</p>
<p>
Hi,my name is
<?php echo $names[2] ?>
</p>
<p>
<?php
$i=0;
while($i<3){
echo "<li>Hi ,my name is $names[$i]</li>";
$i++;
}
?>
</p>
<p>
<?php
$i=0;
while($i<count($names)){
echo "<h3>Hi ,my name is $names[$i]</h3>";
$i++;
}
?>
</p>