Open phpengine opened 7 years ago
Sure - do you have an example of how you'd like to use it? I'm guessing you're after a way to differentiate between the PHP code in a standalone .php
file that should be interpreted on the server by Zend's engine, and the code that should be run client side.
A bit quick'n'dirty, but did you mean something like this? https://jsfiddle.net/y4o3twze/
This is spot on for what I was looking for. I've put an example on http://www.isophp.org.uk you can see. Cheers
<script type="php">
test('App started!');
</script>
var scripts=document.getElementsByTagName("script");
for(var i=0; i<scripts.length; i++){
if(scripts[i].getAttribute('type') == 'php')
{
script_text=scripts[i].text;
try{
php.execute('<?php ' + script_text);
}
catch(e)
{
alert(e);
}
}
}
Could something like this be possible?
Cheers