“Записать в файл php” Ответ

Записать в файл php

$myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
fwrite($myfile, "Content to write to file");
fclose($myfile);
Thoughtful Termite

Записать файл в php

// if not file is there then automatic create and write inside it.
$fptr = fopen('myfile.txt','w');
fwrite($fptr,"i am writing file in this\n");
fwrite($fptr,'writing another line.');
fclose($fptr);
kinjal suryavanshi

PHP записать файл

<?php
$file = 'people.txt';
// Open the file to get existing content
$current = file_get_contents($file);
// Append a new person to the file
$current .= "John Smith\n";
// Write the contents back to the file
file_put_contents($file, $current);
?>
N!ls

Записать в файле с помощью PHP

<?php
$myfile = fopen("file_name.txt", "w") or die("Unable to open file!");
$txt = "Hello world\n";
fwrite($myfile, $txt);
$txt = " Php.\n";
fwrite($myfile, $txt);
fclose($myfile);
?>
Ankur

Ответы похожие на “Записать в файл php”

Вопросы похожие на “Записать в файл php”

Больше похожих ответов на “Записать в файл php” по PHP

Смотреть популярные ответы по языку

Смотреть другие языки программирования