这是我的 html 输出。从 .php 文件
public class Resource {
public static int cliamer = fgfgfger;
public static int reporting = grgrging;
}
我想把它保存到 mytext.java 怎么可能用 php
这是我的 html 输出。从 .php 文件
public class Resource {
public static int cliamer = fgfgfger;
public static int reporting = grgrging;
}
我想把它保存到 mytext.java 怎么可能用 php
像这样的东西:
$myData = "java code goes here";
$fp = fopen('dir/mytext.java', 'w');
fwrite($fp, $myData);
fclose($fp);
这里的主要失败点将是文件夹的权限。
// beginning of your script
ob_start();
// your script
// end of your script
$data = ob_get_contents();
ob_end_clean(); // or ob_end_flush(); if you also want to output something
file_put_contents(dirname(__FILE__).'/mytext.java', $data);