Php is server side scripting language and JavaScript is client side language so it seems to be impossible!
Further Explanation.
PHP is a programming language. It is often used for server side programming, but has uses in general programming too.
JavaScript is a programming language. It is the only language that has a decent level of native support for running in a browser.
Similarity:
- Both languages are almost exclusively for the web and were created specifically for web use in the mid 90s.
- Syntax styles are both based on C
- Until only recently with PHP going full OO, both languages were not officially OO languages
- Both languages are platform independent (compiler or ‘runtime environment’ is required though)
Differences:
- PHP is server side while JavaScript is client side.
- PHP makes use of classes while JavaScript only has constructors and functions.
- JavaScript is used for a lot of visual effects and enhancements for web GUIs.
- Users are able to disable all JavaScript while browsing the internet due to its client-side compilation.
Solution:
AJAX = Asynchronous JavaScript and XML.
AJAX is not a new programming language, but a new way to use existing standards.
AJAX is the art of exchanging data with a server, and updating parts of a web page - without reloading the whole page.
fuctionlike that'll work.function, notfuction.