duanke2503 2016-09-15 13:28
浏览 31

在php中创建运行时环境

How would I possible use or create a runtime environment in php that will communicate constantly with the backend of HTML XML and JS XML? Basicly, how would I make a php script not die but continually running and respond to the HTML XML events requesting the php script, example <form method="post"> is html and is using XML to send the script serverside (to php or other languages) then it refreshes to get a return statement. Normally php would die within' less then a second, but how would I make a runtime which will continually gonna stay open?

Note: Using a runtime is not the same as loading the script in with the javascript interval function!

Using the javascript interval and JQuery/AJAX to simply call the php script makes no different and would not be considered as a correct answer OR be correct at all, cause the interval function and the JQuery load function is calling the file each requested ms, so using those functions would not solve the php runtime mysterium!


This will also mean if there is a way for php to run at a html runtime and create the php runtime to work together (multitasking) then php could be a whole new type of php.. I know that didn't make any sense, but it means you can extend php so much to literally create a timer event to extend multitasking from the php side (class timer {public function start(){ ... } public function stop(){ ... } public function interval($interval /* As Integer */){ ... } public function ON_TICK /* The event running the multitasking from php side */(){ timer::event('on_tick'); } private function event($event){ if($event==='on_tick'){ timer::executeEvent()}}; private function executeEvent($script){/*Script can include if statements and db upload, and conditions, etc*/ /* This will run the script that was called from the function, example $timer1 = new timer;$timer1->interval(1/*In ms*/);$timer1->script("if(1=1){$timer1->stop();}") */}})

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看