English 中文(简体)
Bizarre file_get_contents() conduct withwang-text file and no extension?
原标题:Bizarre file_get_contents() behavior with plain-text files & no extension?

我在几天前就一直在进行当地评估,我已注意到,我的一个外派组织的职责是呼吁外部方案正确打火。 在进一步调查后,很明显,该方案确实执行,但过早地把它作为重要渠道,利用档案——植被——来检索具体档案的内容。

档案是一份没有延期的便衣档案。 I mguessing that file_get_contents() is treatmenting the file as a summary, since there is no extension? 令人奇怪的是,如果我从一个网络浏览器中人工执行同样的方案,所有工作都是完美的。

此处为清晰度的一个实例线——

while(file_get_contents( plaintextfile ) == "something"){
/// Do This
    }

The above works just fine when I visit /program.php from a web browser, but when calling it like this it gives me a file/folder not found error for plaintextfile .

exec( php /program.php , $output);

foreach($output as $output){
print $output . "<br>";
}

Thanks in advance to anyone who can shed some light on this situation. I m really puzzled by this...

最佳回答

由浏览器执行并由指挥线路(exec(>>)执行的方案组合可使用不同的地点。 最好的行动方案是提供通往<条码>解释性文件的全部途径。

if(!file_get_contents( /path/to/plaintextfile )){
   // file couldn t be read
}
问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签