If I did something like this: <? $echo = "<script>document.write("test");</script>"; imagefttext($echo); ?> Would it write the JavaScript output to the image? Obviously I wouldn't be using the document.write function I was just using it as an example. So is this possible?
Ofcourse it wouldn't, you just have a variable with that text in it.. It doesn't get interpreted by javascript at all.. I see no reason why you would want to do this anyway except if you're a code paster that doesn't want to port javascripts to php.
Like I said... I am only using this for an example. So is there anyway to get what JavaScript would output as a PHP variable.
I think it is not possible pudge1. Let's se why: with php you generates the html code. javascript is embeded in the html But you can pass javascript variables as html tags values atributes and get them as php variables after the page submit.
You should tell us what the exact reason is you're trying to do this. It's not possible. There are serverside javascript implementations available, but not interchangeably via php.