Use the following set of commands to add PPA for PHP 7 in your Ubuntu system and install PHP 7.0 version.
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.0Now use the following command to check installed php version on your system.
php -vPHP 7.0.29-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Apr 5 2018 08:34:50) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.29-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies