Are there any best practices for formatting PHP code in a Word document to maintain readability and functionality?

When pasting PHP code into a Word document, it's important to maintain readability and functionality. One way to do this is by using a monospaced font like Courier New to preserve the code's formatting. Additionally, you can use syntax highlighting tools or plugins to color code the code for better readability. Lastly, make sure to adjust the line spacing and indentation to ensure the code is properly formatted.

<?php
// Example PHP code snippet with proper formatting for a Word document
function greet($name) {
    echo "Hello, $name!";
}

greet("World");
?>