PHP code and Footer Text

I have a file called “stats.php” in the main directory of my website that keeps statistics. I can show the statistics at the end of the site by adding the code:

<?php require_once __DIR__ . '/../stats.php';?>

to the “Server Events => Global => All Pages => Page_Foot” section.
But when I add this code to the “footer text” section, it does not pull the data. I think “footer text” only supports HTML codes. There must be a way to do this.

i have edited layout.php manually and it has worked

<div class="ew-footer-text"><?= $Language->projectPhrase("FooterText") ?><br><center><?php require_once __DIR__ . '/../stats.php';?></center></div>

You may also want to read: https://discourse.hkvstore.com/t/dynamic-copyright-year-on-footer/8899/1