File 将数据作为变量存储在PHP文件中是否安全

File 将数据作为变量存储在PHP文件中是否安全,file,server,store,File,Server,Store,例如,如果一个文本文件被上传到我的服务器,我可以创建一个PHP文件并存储 所有有用的数据都作为变量存储在PHP文件中,以便通过函数调用进行访问 <?php $file = (the name of the file); $Value = (the value of the file); function GetValu() { return $Value; } function Getfile() { return $file; } ?> 这不是比必须加

例如,如果一个文本文件被上传到我的服务器,我可以创建一个PHP文件并存储 所有有用的数据都作为变量存储在PHP文件中,以便通过函数调用进行访问

<?php

$file = (the name of the file);

$Value = (the value of the file);

function GetValu()
{
  return $Value;
}

function Getfile()
{
  return $file;
}

?>   

这不是比必须加密文件、创建(受保护的链接)然后通过API调用访问文件更简单、更快吗