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 'alert("测试");';
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!