Hi, I am looking for the best way - to generate html code from a source file (newsletter_preview.php) - display it in a text area - hit a button (= copy html code) - use for a newsletter Any tips?
ok php function highlight_file looks promising. I never used it. will keep you posted i do notice echo'ing in a textarea will add <code><span style="color: #000000"> .... <br /></span> </code> Code (markup): how do i remove the added tags??
highlight_file() uses span tags to colorize the code, theirfore if you wish to include that within a textarea its not directly possible without retaining the tags produced by highlight_file(), (you could use strip_tags() but that would strip other tags too..) However what you could do is use a css to mimic a textareas functionality... (which would mean the code would remain colorized but would only display the code being colorized)