How can proper code formatting help prevent "unexpected T_String" errors in PHP?

Proper code formatting in PHP can help prevent "unexpected T_String" errors by ensuring that strings are properly enclosed in quotes. This error typically occurs when a string is not enclosed in quotes or if there are syntax errors in the code. By following standard coding practices and using an IDE with syntax highlighting, developers can easily spot and correct these issues before they cause runtime errors.

// Incorrect code causing "unexpected T_String" error
$name = John;

// Corrected code with proper string formatting
$name = "John";