Skip to content

IT Blog

Vyacheslav Gapon – personal blog, manuals, articles, notes, development

  • Русский
  • Popular categories
  • YouTube

Tag Archives: POST

How to save a POST request to a file

I’ll give a couple of examples of saving the data of the incoming POST request to a file:

Option 1

$s = implode('|', $_POST);
exec('echo $s >> file.txt');

Option 2

file_put_contents('file.txt', json_encode($_POST));

Example of option 2 with a specific parameter:

file_put_contents('file.txt', json_encode($_POST['parameter']));
Posted byVyacheslav29.10.2017Posted inPHPTags: POSTLeave a comment on How to save a POST request to a file

Categories

Contacts
About it
Privacy
Subscribe by Email (EN)
Подписаться по Email (RU)
YouTube

При использовании материалов, активная ссылка на сайт ixnfo.com обязательна!
When using materials, an active link to ixnfo.com is required!

IT Blog © 2013-2025 Privacy Policy