how to write php code to a file with php

后端 未结 6 628
梦如初夏
梦如初夏 2020-12-20 18:37

For part of my website I need to be able to write php code to a file with php. For example:

$filename = \"RtestR.php\";
$ourFileName =$filename;
$ourFileHand         


        
6条回答
  •  隐瞒了意图╮
    2020-12-20 19:20

    You're missing your closing PHP tag ?>.

    Consider for a moment that what you are doing might not be the best approach anyway. The only use case I can think of for writing out PHP files with PHP would be for some compiled template code or weird caching.

提交回复
热议问题