@sweetline priya
The main thing to realize here is that PHP is a server-side language, while JavaScript is a client-side language.
They can not directly interact with each other. That is; PHP can not directly call a JavaScript function or access JavaScript values, and JavaScript can not directly call a PHP function or access PHP values.
However, because PHP is server-side, you can have PHP print JavaScript code, which will then be executed by the client when it reaches it.
Which also means that you can have PHP print values directly into JavaScript code, like Markus demonstrated.