Call php function from JavaScript

后端 未结 4 595
一个人的身影
一个人的身影 2020-11-21 06:38

Is there a way I can run a php function through a JS function?

something like this:



        
4条回答
  •  走了就别回头了
    2020-11-21 06:59

    PHP is evaluated at the server; javascript is evaluated at the client/browser, thus you can't call a PHP function from javascript directly. But you can issue an HTTP request to the server that will activate a PHP function, with AJAX.

提交回复
热议问题