开发者

Simple task of re-writing of many echo in one. PHP

开发者 https://www.devze.com 2023-02-06 14:11 出处:网络
Please help me re-writing this in a single echo and save it in 开发者_运维技巧a variable ($text)

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消