php function for collating external variables into a single object regardless of GET or POST
- 阅读更多 关于 php function for collating external variables into a single object regardless of GET or POST
问题 I recall reviewing someone else's PHP code once and he had a function or class method that rolled all GET and POST variables into a single plain old object that could then be passed around. If the same name-value pair appeared in both GET and POST, POST would win. Is there a well-coded PHP add-on out there of any sort that does exactly this? 回答1: You could use $_REQUEST, but be aware that it contains the contents of $_GET , $_POST and $_COOKIE , and that the presence (and order, for