PHP code only runs once inside javascript setInterval
问题 I'm just learning PHP and Javascript in a JC class. I have the following for a school project. The following setInterval() runs every 3 seconds, however the embedded PHP code only runs the first time. i.e. newVal gets updated the first time but doesn't change it's value on the following iterations. The script never telnets back into the server to find if the value changed. setInterval(function () { var newVal, mem; <?php $telnet = new PHPTelnet();?>; <?php $result = $telnet->Connect('ip