What are some best practices for highlighting code snippets using geshi in PHP?

When highlighting code snippets using GeSHi in PHP, it is important to follow best practices to ensure proper syntax highlighting and readability. One key practice is to properly set the language parameter when creating the GeSHi object to match the language of the code snippet being highlighted. Additionally, using the set_source method to set the source code to be highlighted and then calling the parse_code method to generate the highlighted HTML output is recommended.

// Create a GeSHi object and set the language parameter
$geshi = new GeSHi($source_code, 'php');

// Set the source code to be highlighted
$geshi->set_source($source_code);

// Parse the code and generate the highlighted HTML output
echo $geshi->parse_code();