Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
$new = str_replace("\r\n", 'разделитель', $keywords);
$new = str_replace("\r\n", '', file_get_contents('1.txt'));
file_put_contents('2.txt', $new);
<?
$num_words = 9;
$fp = fopen('base.txt', 'r');
$fp_out = fopen('out.txt', 'w');
while ($line = fgets($fp))
{
$line = trim(chop($line));
if(str_word_count($line) == $num_words)
{
fwrite($fp_out, $line."\n");
}
}
fclose($fp);
fclose($fp_out);
?>
<?php
$new = str_replace("\r\n", '', file_get_contents('1.txt'));
file_put_contents('2.txt', $new);
?>
Fatal error: Call to undefined function: file_put_contents() in z:\home\localhost\ks\index.php on line 4
define('FILE_APPEND', 1);
function file_put_contents($n, $d, $flag = false) {
$mode = ($flag == FILE_APPEND || strtoupper($flag) == 'FILE_APPEND') ? 'a' : 'w';
$f = @fopen($n, $mode);
if ($f === false) {
return 0;
} else {
if (is_array($d)) $d = implode($d);
$bytes_written = fwrite($f, $d);
fclose($f);
return $bytes_written;
}
}
$file = fopen("file","a");
fputs($file,'что то пишем');
fclose($file);