There is a function in PHP to do that
Archive - Originally posted on "The Horse's Mouth" - 2005-02-21 06:13:31 - Graham EllisOnce you understand the philosophy behind a programming language, you can make superb use of it. Initial learning will show you a few things and get you comfortable, but once you've also learnt a few of the things behind the language you can become a real wizard. Your educated guesses will usually be correct, and you'll be able to move on to write productive original code as you understand the nature of the beast you're using.
PHP is a language that was designed to allow embedded functionality to be provided in the form of extra tags to be interpreted server side from within an extended HTML (this is why I sometimes call it an HTML++ language). There's a huge range of these extra tags, to the extent that I have a regular saying when I'm running a PHP course that goes along the lines "there's a function to do that" ... and some of those functions are truly remarkable.
Would you like to highlight your PHP syntax to help in debugging perhaps? There's a function to do that
highlight_file("../../trainee/h106/a3.php4"); is the only active line in a demo file I've just uploaded. The results presented show one of our training scripts in a much more readable form that the usual monochrome, and without the need to buy any extra editor addins / development tools either.