PHP Programming Fundamentals
Comprehensive test covering PHP syntax, variables, arrays, functions, file operations, HTTP methods, and MySQL database interactions.
Questions
Which of the following is not a comment style in PHP?
- //
- <!__ __>
- /* */
- #
Which of the following is not a PHP tag?
- <?php?>
- <script language=php> </script>
- <? ?>
- <?% %>
In PHP, each statement terminates with semicolon.
- True
- False
In PHP, a variable is represented by a _____ sign followed by the name of variable.
- #
- $
- &
- none of these
PHP is a _______________ scripting language.
- client side
- server side
- client/server side
- none of above
The GET method passes argument from in page to the next page as a part of the _____ query string.
- SQL
- URL
- Both (1) and (2)
- None of these
There is much larger limit on the amount of data that can be passed by using _______ method.
- GET
- PUT
- POST
- None of these
_________ comparison operator is used to check, if $a is equal to $b and they are of the same type.
- <>
- ==
- =>
- ===
PHP is an official module of _________ server.
- Apache HTTP
- ISS
- Netscape
- Windows NT workstation
Which string concatenation operator returns the concatenation of its right and left arguments?
- .= (dot & equal)
- =.(equal & dot)
- . (dot)
- ..(double dots)
Which one is correct for creating array?
- array([key=>] value,.......)
- array)key=>value,.........)
- Both (1) and (2)
- None of these
Which of the following is used to re-index an array?
- arrange(arrayname)
- array_value(arrayname)
- reindexed(arrayname)
- none of these
____________ returns an array comprising a function's argument list.
- func_get_arg
- func_get_args
- func_num_args
- none of these
__________ returns the number of arguments passed to the function.
- func_get_arg
- func_get_args
- func_num_args
- none of these
_________ determines whether a variable is a set.
- isset
- set
- exist
- none of these
Which of the following returns part of haystack string from the first occurrence of needle to the end of haystack with case sensitive?
- stristr(string haystack, string needle)
- strpos(string haystack, string needle)
- strchar(string haystack, string needle)
- strstr(string haystack, string needle)
Which one of the following assigns variable as if they were arrays?
- Assign
- Include
- List
- All of the above
What is the original name of PHP?
- Personal Web Page
- Hypertext Preprocessor
- Personal Home Page
- Hypertext Processor
_________ applies user function to every member of an array.
- array_funct
- array_walk
- array_apply
- in_array
The full form of PHP is
- Hypertext Preprocessor
- Public Home Page
- Personal Web Page
- Personal Home Page
Who is the creator of PHP?
- Team Berneus Lee
- Rasmus Ledorf
- Denis Ritchie
- None of above
________ is used to write a string to a file.
- file_put_string
- file_put_contents
- file_put_char
- none of these
________ delete(s) a file in PHP.
- Destroy
- Unlink
- Both (1) & (2)
- Unlink
_________ will cause a fatal error and termination of the script.
- require()
- require_once()
- both (1) and (2)
- include
You can add PHP to your HTML by putting it in a seperate file and calling it by using PHP's ________ function(s).
- call
- include
- access
- both (1) and (2)
Cookies are stored on a _______ computer.
- client
- server
- client/server
- none of these
XML stands for
- Xtensible Markup Language
- Extensible Markup Language
- Extreme Markup Language
- None of these
___________ is an array containing information such as header, path and script location.
- $_COOKIE
- $_SESSION
- $_REQUEST
- $_SERVER
_____________ fetches a result row as an associative array, a numeric array or both.
- mysql_fetch_row
- mysql_fetch_object
- mysql_fetch_array
- both (1) and (3)
_____________ selects mysqldatabase.
- mysql_select_database
- mysql_select_db
- mysql_connect_db
- mysql_database