What is the syntax for assigning values to two variables simultaneously in PHP?

When assigning values to two variables simultaneously in PHP, you can use the list() function. This function allows you to assign values from an array to multiple variables in one go. Simply create an array with the values you want to assign, and then use list() to assign those values to the variables in the order they appear in the array.

// Assigning values to two variables simultaneously
$values = [10, 20];
list($var1, $var2) = $values;

echo $var1; // Output: 10
echo $var2; // Output: 20