 |
|
Oracle Database Tips by Donald Burleson
|
Data
types
PHP is weakly typed language and variables can be
of any type. The first item that deserves mention is the string NULL in the example above. Variable NULL literally means, "the
absence of value". Saying that the variable has the NULL value is the
same as saying that the variable has no value.
Variables that do have values usually represent
numbers, strings or resources. Variables that represent numbers are
represented by strings of digits, with or without the decimal point.
Numbers can also be written using an engineering notation in which the
number 13500 would be written as 1.35e4, octal or hexadecimal
notation.
The leading zero means the number is written using
octal notation, while prefix "0x" is used for hexadecimal notation.
For example, the expression $a=0100; would set the variable
$a to decimal value of 64 (octal notation), while the expression
$a=0x100; would set the variable $a to the decimal value of 256
(hexadecimal notation).
Boolean Values
In addition to numbers, most programming languages
recognize Boolean values and distinguish between TRUE and FALSE
statements. Conventions in PHP are very similar to those in Perl or
C. The following list shows FALSE values:
§
0
§
"0"
§
0.0
§
NULL
§
array()
§
"" (empty string)
§
The keyword "FALSE"
Any value that is not FALSE is TRUE. The usual
logical operators apply and have the usual precedence identical to the
definitions in other languages. It is worth noting that in contrast to
SQL which adopted the ternary logic in which the NULL value is neither TRUE
nor FALSE, PHP remained TRUE to the classic binary logic.
See
code depot for complete scripts
This is an excerpt from the book
Easy Oracle PHP. You can get it
for more than 30% by buying it directly from the publisher and get
instant HTML-DB scripts from the code depot:
 |
Easy Oracle PHP
Create Dynamic Web Pages with Oracle Data
Includes online HTML-DB code depot
Buy it now for 30% off
- Only $19.95
|
HTML-DB support:
 |
For HTML-DB development support just call to gat an
Oracle Certified professional for all HTML-DB development
projects. |
|