Make web site - 84Part IPHP: The BasicsIn this chapter, we also
84Part IPHP: The BasicsIn this chapter, we also look at how to use the large body of functions already provided inPHP and then, a bit later, how to define your own functions. Luckily, there is no real differencebetween using a built-in function and using your own functions. But first, let s discuss control. Boolean ExpressionsEvery control structure in this chapter has two distinct parts: the test(which determineswhich part of the rest of the structure executes), and the dependent codeitself (whether sepa- rate branches or the body of a loop). Tests work by evaluating a Boolean expression, anexpression with a result treated as either true or false. Boolean constantsThe simplest kind of expression is a simple value, and the simplest Boolean values are theconstants TRUEand FALSE. We can use these constants anywhere we would use a more com- plicated Boolean expression, and vice versa. For example, we can embed them in the test partof an if-elsestatement: if (TRUE) print( This will always print
); elseprint( This will never print
); Or equivalently: if (FALSE) print( This will never print
); elseprint( This will always print
); Logical operatorsLogical operatorscombine other logical (aka Boolean) values to produce new Boolean values. The standard logical operations (and, or, not, and exclusive-or) are supported by PHP, which has alternate versions of the first two, as shown in Table 6-1. Table 6-1: Logical OperatorsOperatorBehaviorandIs true if and only if both of its arguments are true. orIs true if either (or both) of its arguments are true. !Is true if its single argument (to the right) is false and false if its argument is true. xorIs true if either (but not both) of its arguments are true. &&Same as and, but binds to its arguments more tightly. (See the discussion ofprecedence later in the chapter.) ||Same as orbut binds to its arguments more tightly.
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision mysql5 web hosting services