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?
<?php
        # 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

LVL 1
narmi2Asked:
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.

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

http://www.devx.com/opensource/Article/40785

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

  <?php
$result=shell_exec("C:\bash-2.03\bash.exe test.txt");
echo($result);
?>
0

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
NeoAshuraCommented:
glad i could be of service thanks for awarding the points so quickly.
0
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.