Is there a library for this task?
Should there be PHP? If not, you can take a look at
http://en.wikipedia.org/wiki/Microsoft_Compiled_HTML_Help
Find the Microsoft Help Workshop. ( http://www.microsoft.com/downloads/details.aspx?familyid=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en )
The reverse engineering approach is done here: http://www.russotto.net/chm/chmformat.html
So, you can see if you find libraries for several subtasks.
Check phpdoc, it can do chm
There is no direct method for reading / writing a PHP CHM file.
This may help. :) http://savannah.nongnu.org/projects/hhm