php的HTTP_RAW_POST_DATA 用Content-Type=text/xml 類型,提交一個xml文檔內(nèi)容給了php server,要怎么獲得這個POST數(shù)據(jù)。 The RAW / uninterpreted HTTP POST information can be accessed with: $GLOBALS['HTTP_RAW_POST_DATA'] This is useful in cases where the post Content-Type is not something PHP understands (such as text/xml). 由于PHP默認只識別application/x-標準的數(shù)據(jù)類型,因此,對型如text/xml的內(nèi)容無法解析為$_POST數(shù)組,故保留原型,交給$GLOBALS['HTTP_RAW_POST_DATA'] 來接收。 另外還有一項 php://input 也可以實現(xiàn)此這個功能 php://input 允許讀取 POST 的原始數(shù)據(jù)。和 $HTTP_RAW_POST_DATA 比起來,它給內(nèi)存帶來的壓力較小,并且不需要任何特殊的 php.ini 設(shè)置。php://input 不能用于 enctype="multipart/form-data"。