4elements web design & consultancy



  • dislike -1 30

    The Ternary Operator in PHP

    4elements | web design The Hague blog • The Ternary Operator in PHP

    What You'll Be Creating

    From The Video

    The ternary operator allows us to simplify some PHP conditional statements. We'll see how it can be used, with test-driven development and refactoring, to simplify code like:

    Written using a ternary operator, we can write the above comparison as:

    This is obviously a much simpler way to write relatively easy to understand conditional statements and something we should consider when writing future code,

    martijn broeders

    founder/ strategic creative at 4elements web design & consultancy
    e-mail: .(JavaScript must be enabled to view this email address)
    phone: 06 38 55 28 54

By - category

    By - date