- 2009-10-10 (土) 1:07
- PHP
会社でやってて躓いた(半月ほど前に
下記の /hoge.php を /fuga.php から呼び出すとして。
hoge.php
<?php echo 'hogafuge'; ?>
fuga.php
<?php $file1 = file_get_contents('./hoge.php'); $file2 = file_get_contents('http://unolabo.boo.jp/hoge.php'); ?>
$file1 , $file2 それぞれの出力は、
echo $file1;
<?php echo 'hogafuge'; ?>
echo $file2;
hogefuga
と、なるらしい。べんり
最初 $file1 のほうでやっててできません!てなったんだけど、 $file2 でやると出力結果が取れるんですよ、と言われました。(Apachがどうとかっていう説明と共に
でも、readfile(); でも同じなのかすら・・
とりあえず眠いのでまたこんど。
- Newer: mod_rewrite覚え書き
- Older: 【JavaScript】 onclick属性とイベント
Comments:0
Trackbacks:0
- Trackback URL for this entry
- https://unolabo.boo.jp/archives/2009/10/10-file_get_contents%e3%81%a7%e8%ba%93%e3%81%84%e3%81%9f.html/trackback
- Listed below are links to weblogs that reference
- 【PHP】 file_get_contentsで躓いた from うのらぼ。