Dynamically dependent dropdown commonly seen in the country, state, and city selection on the webpage. The data on the child element changes according to the value of the parent element.
The process follows the same way if there are more than 2 dropdown elements.
To do this you can either use only PHP or jQuery AJAX.
In this tutorial, I am using jQuery AJAX to make dynamic dependent dropdown in CodeIgniter.