As far as I can see, the code on the 1st link is written in Perl, not PHP. And the second one is for use within a web page, not between [img] tags on a message board.