Simple task of re-writing of many echo in one. PHP
Please help me re-writing this in a single echo and save it in 开发者_运维技巧a variable ($text
)
echo $_POST['var1'];
echo "f";
echo $_POST['var2'];
$text = '';
$text .= 'www.domain.com';
$text .= $_POST['var1'];
$text .= 'f';
$text .= $_POST['var2'];
$text .= $letter1.$letter2;
$text .= '?name=';
$text .= $_POST['var3'];
$text .= '&pass=';
$text .= $_POST['var4'];
$text .= '&id=';
$text .= $_POST['var5'];
echo $text;
Remember that echo can take multiple arguments (use the comma separator)
echo $_POST['var1'] , "f" , $_POST['var2'];
You don't need to concatenate.
精彩评论