I been seeing the args variable mainly in commands. It seems like it is related to arrays. Can someone explain the args variable.
That isn't much help. Could you at least give me a brief explanation of it? How it functions and is used in PocketMine.
The $args variable, in the context of commands, typically refers to an array of arguments passed to the command. Take the following command for example: Code: /time set day The contents of $args would be PHP: ["set", "day"] So we could do PHP: $args[0]; // "set"$args[1]; // "day" Variable names are arbitrary, not all variables called "args" will be argument arrays and not all argument arrays will be called "args". I think this answers your question though.
In PocketMine $args is the array of all command arguments. Don't confuse $args with $argv. They are two different things. In fact $argv is the array of all command line arguments of PHP CLI
Except global variables (you won't use them in PocketMine plugins) and $this, all other variables are defined and named by yourself. Usually the first occurrence in a function defines it.
I was asking for a direct description, one of main points of creating this thread. Yeah, I also looked around Google trying to find answers, I didn't really understand what args meant even by looking on php.net, so I asked the PocketMine community. What's your problem with that?
Simple. $args is not predefined. It is defined by you. $args is the name of the array. Refer to @Falk's example earlier.