Home  >  Article  >  Backend Development  >  Can js be written in PHP?

Can js be written in PHP?

藏色散人
藏色散人Original
2019-10-23 09:17:023590browse

Can js be written in PHP?

Can js be written in PHP?

able.

js is passed to the front end.

So just add js to the output of php.

For example:

<?php
echo &#39;alert(&quot;测试&quot;);&#39;;

In fact, just treat the JS code as a simple string.

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of Can js be written in PHP?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn