有什么方法可以将windows cmd/b实现到php中吗?
二进制文件加入。我尝试了很多(通过file_get_contents&file_put_contents),但似乎不起作用。。。
<?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