如何在php中复制一组变量[duplicate]

This question already has an answer here:

I want to make a php variable a group of other variables so that I can put the new group of variables into a .txt file. Something like:

    $txt = $_GET["html"]
    $txt2 = $_GET["js"]
    $txt3 = $_GET["php"]
    $txt4 = $_GET["other"]
    $text = $txt $txt2 $txt3 $txt4;
    $filename = fopen("config.txt", "w");
    fwrite($filename, $text);
    fclose($filename);

I have searched on Google and Stack Overflow, but nothing seems to solve my problem.

</div>

If you just want to combine multiple string values into one string value then the term you're looking for is "concatenate", which in PHP is done with the . operator:

$text = $txt . $txt2 . $txt3 . $txt4;