This article represents some high-level concepts and a code example on how to write a PHP class and use it…