How can you use php in a javascript function [duplicate]
You can’t run PHP code with Javascript. When the user recieves the page, the server will have evaluated and run all PHP code, and taken it out. So for example, this will work: alert( <?php echo “\”Hello\””; ?> ); Because server will have evaluated it to this: alert(“Hello”); However, you can’t perform any operations in … Read more