Hi! Does anybody of you guys now where i can find a news script that is highlighting PHP? I shall use it for articles and therefor it's importent that it highlights PHP. ex: if I write an article about the mail() funcsion i want it to highlight the code that i tell it to do. exempel by simply adding "{PHP} {/PHP}" something like this: "{PHP} mail(test@test.com, subject, mailtext); {/PHP}" and it shows the code highlighted: like this: mail(test@test.com, subject, mailtext); PHP: can anyone help me with this?? / best regard Kip
Assuming your article is stored as the variable $articletext then you can use the following. $articletext = str_replace("{PHP}", "<div style=phpcode>", $articletext); $articletext = str_replace("{/PHP}", "</div>", $articletext); This will wrap some div tags round the php code and you can then define how it will look using css. Not sure whether this is the best way to do it but I reckon it will work fine.