What is the purpose of using Geshi for syntax highlighting in PHP code?

Geshi is a PHP library that provides syntax highlighting for code snippets. By using Geshi, you can easily format and colorize your PHP code to make it more readable and visually appealing. This is particularly helpful when sharing code on websites, blogs, or forums where proper syntax highlighting can enhance the overall user experience.

// Example of using Geshi for syntax highlighting in PHP code
require_once('geshi.php');

$source_code = '<?php echo "Hello, World!"; ?>';

$geshi = new GeSHi($source_code, 'php');
echo $geshi->parse_code();