You can create a script to switch from versions: sudo nano switch_php
then type this:
#!/bin/sh
#!/bin/bash
echo "Switching to PHP$1..."
case $1 in
"7")
sudo a2dismod php5.6
sudo a2enmod php7.0
sudo service apache2 restart
sudo ln -sfn /usr/bin/php7.0 /etc/alternatives/php;;
"5.6")
sudo a2dismod php7.0
sudo a2enmod php5.6
sudo service apache2 restart
sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php;;
esac
echo "Current version: $( php -v | head -n 1 | cut -c-7 )"
exit and save
make it executable: sudo chmod +x switch_php
To execute the script just type ./switch_php [VERSION_NUMBER]
where the parameter is 7 or 5.6
That's it you can now easily switch form PHP7 to PHP 5.6!