What actually i want to do is to get contents from the winword file in my web page.
for this purpose i used the exec() method, i also tried the following code:
$pCom = new COM("WScript.Shell");
$pShell = $pCom->exec("Notepad.exe");
$sStdOut = $pShell->StdOut->ReadAll; # Standard output
$sStdErr = $pShell->StdErr->ReadAll; # Error
the above code through an Exception that:
Fatal error: Class 'COM' not found in D:\xampp\htdocs\test\tests\Notepad.php on line 9
I have no idea what to do and how to do this?
You have two issues with your approach:
a text editor does not output text written in it when closing the editor. So why would you expect to receive the text when firing the editor by means of an
you miss understood how the
exec() command actually works, I assume you did not really read the documentation of the
exec() function which clearly states that the return value of an executed command is the last line of its output. That is not what you want.