can $_FILES superglobal be accessible in class
Does anyone have experience wi开发者_StackOverflow社区th this
I wanted to use $_files in my class
like
$Uploadfile= $_FILES['file'];
but then the script errors
I thought superglobals were acccessible anywhere
thanks, Richard
Yes, $_FILES
is a superglobal, which means that it's accessible from every scope. It's only set if the request actually contains a multipart/form-data
body.
精彩评论