PHP: How do you access the php://input stream?
The php://input
contains the raw data from a POST request, after all of the HTTP headers. You can think of $_POST
as the same data (...sometimes) that has been parsed into an array. php://input
gets the raw data. The stream can be accessed in the following way:
- $val = file_get_contents("php://input");
More...
Comments and discussion about How do you access the php://input stream?
Found this interesting? Maybe you want to read some more in this series?
Or see other topics in the PHP language
Arrays
General
PHP Basics
Or see other languages/frameworks:
PHP Laravel Composer Apache CentOS and Linux Stuff WordPress General Webdev and Programming Stuff JavaScriptOr see random questions
What is Bubble sort, and how to write an implementation of it in PHP
How to pick what array_intersect function to use in PHP?
How to create random numbers in JS?
What is the difference between integration and unit tests?
How to make Apache force download of files (in .htaccess)
Push vs Pop vs Shift vs Unshift
How to set the Expires header in .htaccess
How to get the type of a variable in JS?
How to Enable Directory Listings in Apache with .htaccess
What is WordPress default Apache .htaccess rules?