PHP Data Types and Output Functions
Tests knowledge of PHP data types, string handling, output functions, commenting, and code delimiters.
Questions
Which of the following statement produce different output
- <?echo "This is php example"; ?>
- <P="This is php example"; ?>
- <?PHP echo "This is php example"; php?>
- <script language="php"> print "This is php example";</script>
Which of the following delimiter is ASP style?
- NONE
- <% %>
- <? ?>
- <script language="php"> </script>
Php supports all four different ways of delimiting. In this context identify the false statement
- You can use any of the delimiting style
- You can use different delimiting styles in same page
- You can use any delimiting style but must use a single style consistently for a page
- Variables declared in previous blocks are remenbered on later blocks too!
Which of following commenting is supported by Php
- Single line c++ syntax - //
- Shell syntax - #
- Both of above
- None of above
To produce the output6 I love the summer time, Which of the ofllowing statement should be used?
- <? Php print ("<P> I love the summer time</p>";?>
- <? Php $ season="summer time"; print"<p> I love the $ season</p>"; ?>
- <?Php $ message="<p> I love the summer time </p>; ecdho $ message; ?>
- All of above
Which of following function return 1 when output is successful?
- echo ( )
- print ( )
- both
- None
Which of followng statement is more suitable if you want to output a blend of static text and dynamic information stored within one or several variables?
- echo ( )
- print ( )
- Print f ( )
- None of above
Which of the following type specifier is invalid in print f ( ) functions
- % a
- % b
- % c
- % d
Which of the following function can assign the output to a string variable
- echo ( )
- print ( )
- print f ( )
- s print f ( )
Which of the following data type is not seal or datetype supported by PHP
- Array
- String
- Float
- Boolean
Which of the following data type is compound datatype supported by PHP
- Array
- String
- Float
- Boolean
If a boolean variable $ alive= 5;
- $ alive is false
- $ alive is true
- $ alive is overflow
- the statement is snot valid
For integer data type PHP 6 introduced
- 8 bit integer value
- 16 bit integer value
- 32 bit integer value
- 64 bit integer value
For integer data type PHP 5 and earlier supported
- 8 bit integer value
- 16 bit integer value
- 32 bit integer value
- 64 bit integer value
Trace the odd data type
- floats
- integer
- doubles
- Real number
Which of the folowing are valid float values?
- 4.5678
- 4.0
- 7e4
- All of above
In php string data are
- delimited by single quote
- delimited by double quote
- delimited by <<< identifier
- All of above
Which of the following delimiting method is known as string Interpolation
- delimited by single quote
- delimited by double quote
- delimited by <<< identifier
- All of above
Which datatypes are treaded as arrays
- Integer
- Float
- String
- Booleans
Which of following are compound data type?
- Array
- Objects
- Both
- None