###前提・実現したいこと
phpを実行して別ファイルへの書き出しをしたい
###発生している問題・エラーメッセージ
うまく別ファイルの出力できない
###該当のソースコード
class debugController extends commonController{ function __constract(){ } function action_index(){ } function action_debugFile(){ self::debugFile(); exit; } public function debugFile(){ $file = 'test.txt'; $current = file_get_contents($file); $current .= "John Smith\n"; file_put_contents($file, $current); } }
###補足情報(言語/FW/ツール等のバージョンなど)
debugFileを実行しブラウザではエラーなどは出てないが、test.txtには書き込まれていないのでその原因を知りたいです。プログラム初心者の為、質問に不備があるかもしれませんが、ご教授くださいませ。
回答4件
あなたの回答
tips
プレビュー