无法使用rpc xml将内容写入文件

时间:2011-07-01 08:43:31

标签: php

我有一些内容要写入名为bk_strategy-ptr-to-real-file.h的文件。这是代码:

echo $content = $header.$parameters.$footer;

$myFile = "/home/vikas/hft/common/internal/config/trader/master/bk_strategy-ptr-to-real-file.h";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $content);
fclose($fh);

是否可以使用xml rpc编写文件?

1 个答案:

答案 0 :(得分:0)

您不使用xml-rpc写入文件,它是一种通信协议。您使用您的php或asp来编写文件。你有什么是好的:

$myFile = "/home/vikas/hft/common/internal/config/trader/master/bk_strategy-ptr-to-real-file.h";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $content);
fclose($fh);

但是为什么文件是.h扩展名,如果它不是.xml,或者可能是.txt或.php,这取决于你接下来要对响应做什么。