What is the purpose of the highlight_string() function in PHP?

The highlight_string() function in PHP is used to syntax highlight a string using colors to make it more readable. This can be useful when displaying code snippets on a website or in a text editor. It helps to differentiate between different parts of the code such as keywords, strings, comments, etc.

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