What best practices should be followed when declaring and using variables in PHP scripts?

When declaring and using variables in PHP scripts, it is important to follow best practices to ensure code readability and maintainability. Some best practices include using descriptive variable names, initializing variables before use, and avoiding global variables whenever possible.

// Declare and initialize variables with descriptive names
$firstName = "John";
$lastName = "Doe";

// Initialize variables before use
$total = 0;

// Avoid using global variables
function calculateTotal($price, $quantity) {
    $total = $price * $quantity;
    return $total;
}