What are the best practices for maintaining PHP code formatting when pasting into Word with different versions?

When pasting PHP code into Word with different versions, the best practice is to use a plain text editor to remove any formatting before pasting into Word. This will ensure that the code maintains its original formatting and is easier to read. Additionally, using a monospaced font in Word can help preserve the alignment of the code.

<?php
// PHP code snippet with proper formatting for pasting into Word
echo "Hello, World!";
?>