I have installed html-to-text through Node.js . When I run the following command in the shell:
C:\> html-to-text < D:\test.html --tables=true --wordwrap=false > D:\test.txt
the file D:\\test.html
is properly converted to txt and I find the proper output next to it in D:\\
folder.
However, if I try to run exactly the same command through PHP on my local server:
<?php
exec('html-to-text < D:\\test.html --tables=true --wordwrap=false > D:\\test.txt');
?>
The script runs and produces a .txt file, but the .txt file is empty.
What causes this different behavior? How should I run the script through PHP and get the proper result instead of empty file? Thanks for any suggestion!