Solution:1
PHP runs on the server, not in the browser. There is no way for it to interact directly with a page loaded in a browser. PHP can generate a page and send it to the browser to display, but that’s the end of the story. If you want to manipulate the page without reloading, you need a client-side technology. This means Javascript in 99.9% of cases.
If you need something from the server, you can use Javascript to fetch the result of a PHP script and insert it on your page without reloading but, even though PHP can be involved, all of the client-side actions will be performed by Javascript.