If im really mistaken, this is simple:
<?php include 'test.php'; ?>
To include the test.php file in index.php
Then you can call them as if they were the variables specified in index.php, I would do the following to get them in jQuery:
$ ("# test1"), etc.
Update
The problem is that the variables in test.php will change constantly, and then they must be updated on index.php. I set them as 1, 2, and 3 to verify this. - user683526 1 min ago
In this case, set them to a function and return the values.
source share