1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Get a message in $args

Discussion in 'Development' started by SkyArt4, Mar 13, 2017.

  1. SkyArt4

    SkyArt4 Silverfish

    Messages:
    16
    GitHub:
    nadaree
    public function onCommand(CommandSender $sender, Command $cmd, $label, array $args)

    I want to get this '$args' message.

    It's just a trivial thing,Will you tell me?(A little English is going wrong this time)
     
    Muqsit likes this.
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Can you explain a little, like what you want to do with it? You already have $args, assuming you registered your command correctly. If you want the first subcommand, you can use $args[0].
     
  3. hoyinm14mc

    hoyinm14mc Silverfish

    Messages:
    22
    Do you mean combining all values of the $args array to a string?
    PHP:
    $string implode(" "$args);
    The first parameter is character(s) separating words in $args
     
    SkyArt4 likes this.
  4. SkyArt4

    SkyArt4 Silverfish

    Messages:
    16
    GitHub:
    nadaree
    Thank you.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.