PHP 7.3 reached end of life on 06 Dec 2021 and is no longer being updated. It's strongly recommended to upgrade to the latest version as soon as possible. You can read the official PHP migration guide here.
sudo apt update
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.3
sudo apt install php7.3-common php7.3-mysql php7.3-xml php7.3-xmlrpc php7.3-curl php7.3-gd php7.3-imagick php7.3-cli php7.3-dev php7.3-imap php7.3-mbstring php7.3-opcache php7.3-soap php7.3-zip php7.3-intl -y
php -v
You should see output similar to:
PHP 7.3.x (cli) (built: ...) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.x, Copyright (c) 1998-2018 Zend Technologies
php -m
This will list all installed PHP modules.
php --ini
This will show the location of the PHP configuration file.