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

Can Explain help me this command line

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

  1. FanTSM

    FanTSM Spider Jockey

    Messages:
    28
    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 Skeleton

    Messages:
    955
    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 Jockey

    Messages:
    28
    GitHub:
    nam2k
    Thanks 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.