1

I've PHP variable which contains some HTML code. For the sake of presentation, let's say the variable contains

// abc.php file
$table =  '<table>';
$table .=    '<tr><td>Hi there!</td></tr>';
$table .=    '<tr><td>How are you</td></tr>';
$table .= '</table>';
echo $table;

I'm planning to run abc.php through a cron job. So is it possible that the output that is to be generated by abc.php be converted into an image and get stored in a folder?

So basically when abc.php is done parsing, an image should be created when the cron job finishes. Is this even possible?

PS : I've looked at Phantomjs which seems ideally designed for such a task, but there are a few problems with it:

(a) It's platform dependent (Windows, Linux, Mac OS etc)

(b) I want to avoid using a .exe file on my server.

6
  • 1
    At least, you have to have "headless" web-browser to render content. Another option is to draw the table manually using gd. Commented Mar 30, 2013 at 14:29
  • Which is what Phantomjs does, right? Commented Mar 30, 2013 at 14:30
  • There are at least 2 similar topics: stackoverflow.com/questions/1963900/… , stackoverflow.com/questions/13039627/… Commented Mar 30, 2013 at 14:34
  • Does it have to be saved as an image? Can't you just save the output as a static html file? Commented Mar 30, 2013 at 14:35
  • @jszobody It has to be saved as an image as it will used in a ppt file later. Commented Mar 30, 2013 at 14:37

1 Answer 1

0

If you need only tables, it will be easier to you save the output as .xls file, which you'll can include to ppt file when you'll need it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.