Trying to read a small text file in php into a js variable. But the alert shows nothing even though the contents of "tmp/data.txt" = 30086895
function sort_rating() {reset_colors(); read_reg;
myArray = myArray.sort(function(a, b){ return b.rate - a.rate;}); fortify(); newcomers();}
function newcomers() {
// data = '<?php clearstatcache(); echo readfile("tmp/data.txt"); ?>'; alert(data);
data = '<?php clearstatcache(); echo file_get_contents("tmp/data.txt"); ?>'; alert(data);
}
How can I make this work, please?