Basically, you are mixing server-side (PHP) and client-side (JS) scripting.
It is however possible - thanks eg. to AJAX. Because you was not specific about what do you exactly need to be done after the select box changes, I can only point you to some resources and propose following:
onchange event was fired) - eg. using .post() jQuery function,json_encode() in PHP, but raw HTML is also ok) and use it in JS,