【问题标题】:codeignite file_get_contens not working when angularjs variable through file path is send当通过文件路径发送 angularjs 变量时,codeigniter file_get_contents 不起作用
【发布时间】:2017-11-07 10:14:45
【问题描述】:

$scope.formatfilename = response.filename[0].filepath;//它包含我的文件路径,例如http://localhost:8080/abc/myfloder/ab.html

$filename1 ='{{formatfilename}}'; // 我在 codeIgniter 视图中访问上述路径。当我回显这个变量时,它也有文件路径

echo file_get_contents($filename1);

它给了我文件未找到错误。但是如果,我将静态 url 传递给 file_get_contents() 方法,它会给出结果。 有什么办法吗??

【问题讨论】:

  • 尝试在浏览器中访问文件url($filename的值),找到了吗?
  • 在浏览器中找到

标签: angularjs codeigniter


【解决方案1】:

可能是拼写错误。应该是$filename1

echo file_get_contents($filename1);

【讨论】:

    猜你喜欢
    • 2015-07-12
    • 1970-01-01
    • 2014-01-20
    • 1970-01-01
    • 1970-01-01
    • 2023-03-12
    • 1970-01-01
    • 1970-01-01
    • 2016-08-30
    相关资源
    最近更新 更多