Home > Backend Development > PHP Tutorial > How to embed php code in javascript? _PHP Tutorial

How to embed php code in javascript? _PHP Tutorial

WBOY
Release: 2016-07-21 14:57:02
Original
1594 people have browsed it

Today when I was wandering around a website forum, I found that a friend asked: How to embed PHP code in JavaScript?

This is a very simple question, so I posted it online to share with everyone, there is no end to learning!

The question is this:

How to embed php code in javascript?
I am a newbie, please don’t find me annoying! Hehe...

A friend answered this way:

alert("");

The editor looked at it and found it not very easy to use, so he analyzed the reasons:

Generally JS is done on the template page.

Not many people can write in PHP. Not conducive to modification.

If you want to interact with PHP, you can use

PHP’s JSON. That’s it. I hope this article will be helpful to PHP beginners. Welcome everyone to come to Agni Website Building Academy frequently!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/364113.htmlTechArticleToday when I was hanging out on a website forum, I found that a friend asked: How to embed PHP code in JavaScript? This is a very simple question, so I posted it online to share with everyone, learn...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template