tags:

views:

65

answers:

1

I want to call a JavaScript function through PHP and store the returned value in a PHP variable. How to do this?

+1  A: 

You can't do that - javascript being a client side technology will execute after your PHP script has already finished so there's no way to do what you are looking to accomplish.

Marek Karbarz
you can do that - for an example, see http://stackoverflow.com/questions/419240/how-to-get-javascript-function-data-into-php-variable
ax
technically you're not calling a javascript function from PHP, you're just using AJAX to get a PHP page - so it's going javascript -> PHP not PHP -> javascript
Marek Karbarz