script to output results

Dear Experts,

Please have a look at the php script below, it runs a command using exec and captures the value returned by the command.  How do I put this command into a bash script file, then get php to run that script file?
        # file to be converted
        $dirty_string = "file.pdf";
        $clean_string = escapeshellarg($dirty_string);
        # command to convert the file
        $command = "pdftotext -raw -enc UTF-8 ".$clean_string." -";
        # executing the command
        exec($command, $retval);
        # saving converted array to string
        $mystring = implode("",$retval);
        # use string to save to database
        echo $mystring;

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

first;y download this tool and run it. its for bash u may already have it..

then secondly save your file as a text file .txt and run it using php.. as follows..

$result=shell_exec("C:\bash-2.03\bash.exe test.txt");

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
glad i could be of service thanks for awarding the points so quickly.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.