输入流 php://input
$_POST 与 php://input
$HTTP_RAW_POST_DATA 与 php://input
var_dump($_POST); echo file_get_contents("php://input");<form enctype="multipart/form-data" method="post"> <input type="text" name="name" /> <input type="file" name="csv_file" /> <button type="submit" name="submit" value="Submit">Submit</button> </form> <?php var_dump($_POST); echo "<br>"; var_dump(file_get_contents("php://input"));<form method="post"> name:<input type="text" name="name" /><br> age:<input type="text" name="age" /> <button type="submit" name="submit" value="Submit">Submit</button> </form> <?php echo '$_POST result:<br>'; var_dump($_POST); echo "<br>"; echo 'php://input result:<br>'; var_dump(file_get_contents("php://input"));$_POST result: array (size=3) 'name' => string 'revin' (length=5) 'age' => string '28' (length=2) 'submit' => string 'Submit' (length=6) php://input result: string 'name=revin&age=28&submit=Submit' (length=31)
Last updated
