Bigger tban x, smaller than y (PHP)

Posted on 2009-02-22
Last Modified: 2012-05-06
How can I do this?

if ($number >1<9) echo 'Number is larger than 1 and smaller than 9.';

Open in new window

Question by:hankknight
    LVL 34

    Accepted Solution


    if ($number > 1 && $number < 9) echo 'Number is larger than 1 and smaller than 9.';

    Open in new window

    LVL 8

    Expert Comment

    like this

    if ( $number < 9 and $number > 1 ){echo $number;}

    Open in new window

    LVL 34

    Expert Comment

    by:Terry Woods
    Both those will work - see the documentation here, if you like:

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    The viewer will learn how to dynamically set the form action using jQuery.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now