How can the PHP code be improved to ensure proper formatting and readability for better code maintenance?

To improve the formatting and readability of PHP code for better maintenance, it is recommended to follow consistent coding standards such as PSR-12. This includes using proper indentation, meaningful variable names, commenting code sections, and organizing code into logical sections. Additionally, using an IDE or code editor with syntax highlighting and code formatting tools can also help in maintaining clean and readable code.

<?php

// Define variables with meaningful names
$firstNumber = 10;
$secondNumber = 20;

// Calculate the sum of two numbers
$sum = $firstNumber + $secondNumber;

// Output the result
echo "The sum of $firstNumber and $secondNumber is: $sum";

?>