What is the best way to display PHP code on a website to maintain formatting and color?

To display PHP code on a website while maintaining formatting and color, you can use a code highlighter library like Prism.js or highlight.js. These libraries offer syntax highlighting for various programming languages, including PHP, and can be easily integrated into your website. By using these libraries, you can ensure that your PHP code is displayed in a visually appealing and easy-to-read format for your website visitors. ```html <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/themes/prism.min.css"> </head> <body> <pre><code class="language-php"> <?php echo "Hello, World!"; ?> </code></pre> <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/prism.min.js"></script> <script>Prism.highlightAll();</script> </body> </html> ```