Can Explain help me this command line

Discussion in 'Plugin Help' started by FanTSM, Mar 4, 2019.

  1. FanTSM

    FanTSM Spider

    Messages:
    10
    GitHub:
    nam2k
    $args[1] <= 5 ? $args[1] : 1;
    I want to know the use of the "?" in the above command line please
     
  2. Levi

    Levi Zombie Pigman

    Messages:
    674
    GitHub:
    captainleviftw
    The code you showed is called a ternary operator... it's the shortcut for if {} else {} statement
    https://stitcher.io/blog/shorthand-comparisons-in-php
     
    HimbeersaftLP likes this.
  3. FanTSM

    FanTSM Spider

    Messages:
    10
    GitHub:
    nam2k
    Thanks You
     

Share This Page

  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.