php runs on serverside, javascript on clientside.
php can send javascript to the client like html. but every var you can change on the client with javascript you have to send back to the server before php can react to it.
you can use hidden frames to send data invisible to the server and get the response in a different frame. but thats only a trick. its of limited usefulness