For my application I have to write a technical manual. In this manual I would like to show pieces of my php script. At the beginning I thought I can copy the code from eclipse to word. But when I do this, de code isn’t highlighted. Now I wrote a little php script that returns you the highlighted source from any php file you want. You have to wrote the foldernames write to an array. And this script will you highlight all php files in this folders.
After you have the highlighted source in your browser, copy and paste it.
$folders = array('classes', 'functions','.');
foreach($folders as $folder) {
$verz = opendir($folder);
while($file=readdir($verz)) {
if($file!='.' AND $file!='..') {
if(substr($file, -3)=='php') {
echo ''.$file.'';
show_source($folder.'/'.$file);
echo '
';
}
}
}
closedir($verz);
}
Download the source here.