有没有办法将windows cmd / b实现到php?
我的意思是,二进制文件加入。我尝试了很多(通过file_get_contents& file_put_contents),但它似乎不起作用......
答案 0 :(得分:0)
<?php
$target = 'c:/temp/fileA.dat';
$sources = array(
'c:/temp/file1.bin',
'c:/temp/file2.dat',
'c:/temp/file3.foo',
'c:/temp/file4.'
);
foreach($sources as $src) {
$fp = fopen($src, 'rb') or die('fopen failed...');
file_put_contents($target, $fp, FILE_APPEND);
}
见
http://docs.php.net/fopen
http://docs.php.net/file_put_contents