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?
 
NeoAshuraConnect With a Mentor Commented:
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
 
NeoAshuraCommented:
glad i could be of service thanks for awarding the points so quickly.
0
All Courses

From novice to tech pro — start learning today.