【发布时间】:2011-02-12 04:47:00
【问题描述】:
通过这个问题,我的意思是,例如,如果某人的用户名是“bob”,那么 while 循环条件将是 ($i 10)
if($username == "bob")
{
//make this while loop condition: ($i < 10)
// it means: while($i <10){ so stuff}
}
else
{
//make the while loop condition: ($i >10)
}
【问题讨论】:
-
我认为这是一个设计问题。尝试使用策略模式(谷歌它),你可以在你的界面上使用一些方法来引导循环/条件。
标签: php loops conditional-statements while-loop