sudo update-alternatives --config php
This command will list the options in table format to choose from the current installed php versions on you linux operating system
There are 2 choices for the alternative php (providing /usr/bin/php).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/php8.1 81 auto mode
* 1 /usr/bin/php8.0 80 manual mode
2 /usr/bin/php8.1 81 manual mode
Where you see the * meaning it is currently being used as a default php version. in my case I have selected it manual to 8.0
You can choose the number from selection column and hit enter, the selected php version will be applied.
Press <enter> to keep the current choice[*], or type selection number: