They say that It is not possible, but what about it? I was working on project to improve my skills and found a trick to run PHP from JS.
async function runphp() {
const response = await fetch('phpfile.php');
const data = await response.json(); //optional
}
So we just make a request and all the code inside PHP will run. Also for eg. if we want just one function from PHP to run it is possible to make cookie in javascript, read it in php and run only some functions based on cookie value. I don't know anything about security and I'm working on localhost so the question is: Is it good if I add project with this on my website?