What PHP functions can be used to properly highlight PHP code in a blog post?

When displaying PHP code in a blog post, it is important to properly highlight the syntax for readability. One way to achieve this is by using the highlight_string() function in PHP, which will format the PHP code with syntax highlighting. Another option is to use the highlight_file() function to display the contents of a PHP file with syntax highlighting.

<?php
$code = '<?php echo "Hello, World!"; ?>';
highlight_string($code);
?>