When you start to write something with PHP, which is something you will often use the variables already have to…