Page 54 - Open Soource Technologies 304.indd
P. 54

Web Technologies-I



                   Notes         Self Assessment
                                 Multiple choice questions:
                                    6.  An ................. is a variable that holds a group of values.
                                       (a)  string                     (b)  literal
                                       (c)  array                      (d)  queue
                                    7.  ................. is just a name assigned to reference a location in memory where some value is
                                      stored.
                                       (a)  String                     (b)  Literal
                                       (c)  Array                      (d)  Variable
                                 True or False:
                                    8.  Null is a special data type which can have only one value.
                                       (a)  True                       (b)  False
                                    9.  PHP is capable of functioning as an object-oriented programming language (DOP).
                                       (a)  True                       (b)  False
                                   10.  The scope of a variable is not the portion of the script in which the variable can be referenced.
                                       (a)  True                       (b)  False

                                 2.5 Summary

                                    •  PHP is a general-purpose server-side scripting language originally designed for web
                                      development to produce dynamic web pages. For this purpose, PHP code is embedded
                                      into the HTML source document and interpreted by a web server with a PHP processor
                                      module, which generates the web page document.
                                    •  All variables in PHP are prefixed with a dollar sign. The dollar sign is not technically part
                                      of the variable name, but it is required as the first character for the PHP parser to recognize
                                      the variable.
                                    •  Local scope is specific to functions. PHP does not have a block level scope. If you want a
                                      block level scope, your best bet is to emulate it with a recursive function.
                                    •  An operator combines simple expressions together into more complex expressions by
                                      creating relationships between the simple expressions that can be evaluated.
                                    •  When expressions and operators are assembled in such a way as to produce to a piece of
                                      code that actually does something, you have a statement. Statements end in semicolons
                                      and are the programming equivalent of the complete sentence.
                                    •  Most operators in PHP are binary operators; they combine two operands (or expressions)
                                      into a single, more complex expression. PHP also supports a number of unary operators,
                                      which convert a single expression into a more complex expression.

                                 2.6 Keywords

                                 Boolean: A Boolean value assesses the truth value of something. Booleans only have two values,
                                 true and false. These two values are represented by the keyword literals of the same name. All
                                 conditionals return a true/false Boolean value based on the condition being tested.
                                 Floating-point numbers: Floating-point numbers are also sometimes called real numbers. They
                                 are numbers that have a fractional component.
                                 Integer: An integer is a whole number. That is to say, it is a number with no fractional component.
                                 Keywords: A keyword is a reserved word in the PHP programming language. Keywords are used
                                 to perform a specific task in the computer program.


        48                                LOVELY PROFESSIONAL UNIVERSITY
   49   50   51   52   53   54   55   56   57   58   59