// php string variable:
$content = "Something in string........bla bla bala.......".
while(.....){}
."agian string...";
echo $content;
// i am getting error => unexpected T_WHILE in my php....
答案 0 :(得分:3)
function myFunction() {
while(....) {
...
}
return $something;
}
$content = "Something in string........bla bla bala......." . myFunction() . "agian string...";
echo $content;
答案 1 :(得分:2)
不,你不能这样做,但你可以这样做。
$content = "Something in string........bla bla bala.......";
while(.....){
$content .= "agian string...";
}
echo $content;
答案 2 :(得分:2)
没有。不,你不能。
正确使用字符串连接:
$content = "Start";
while (<something>) {
$content .= "Middle";
}
$content .= "End";
答案 3 :(得分:1)
没有。你必须在循环中追加:
$content = "Something in string........bla bla bala.......";
while ($i++ < 20) {
$content .= 'something else';
}
$content .= 'something to end';
echo $content;
答案 4 :(得分:0)
不知道,while(...)
- 部分应该做什么,但implode()可能会有所帮助