php get less than the value of post

Generally this happens when ajax submit

When we set the parameter ajax contentType: 'application / json; charset = utf-8', with file_get_contents ( "php: // input") to get the value of $ _POST is not acquired

1. Check the content-type header is not for the "content-type: application / x-www-form-urlencoded" This transfer is used to submit data php $ _POST embodiment form acceptable manner.

2. If the content-type header information is not for the "content-type: application / json" This transfer is based on data submitted by way json, php need to use file_get_contents ( "php: // input") way to get the input stream acceptance

Guess you like

Origin www.cnblogs.com/lichihua/p/11025396.html