you can't do this through php as once the page is already generated php no longer interacts with it.
Look into javascript
What you need to do is get all the possible choices and store them into javascript arrays.
then access those arrays with onchange events