Jump To Content
LearnHub
Home
Schools
Communities
Sign In
or
Sign Up
Search LearnHub
Keywords
Community
Open Source
Primary Navigation
Home
Lessons
↓
Lessons
Videos
Presentations
New Lesson
New Video
New Presentation
Tests
↓
Newest
Most Popular
Highest Rated
New Test
People
↓
Newest
Highest Authority
Leaders
Join Community
Discussions
↓
Newest
Hottest
New Discussion
New Debate
PHP Basics
A test by
Lawrence Badanai
.
Test Questions
Question
Curly Braces in PHP are used to define:
Answers
Correct
Answer Text
A block of code
A piece of code in another language
A comment
Question
The maximum length of a string held in a variable is ...
Answers
Correct
Answer Text
Just under 4 Megabytes
1024 bytes
There is no practical limit
10240 bytes
Question
PHP is available
Answers
Correct
Answer Text
As part of a Sun product
Open Source
As part of a Microsoft product
From Oracle
Question
Who do you need to contact to obtain a license if you want to use PHP?
Answers
Correct
Answer Text
No-one; it's open source and there's no need to register
You can buy a license at your local computer store
licensing@php.net
Question
How does PHP interface to the web server?
Answers
Correct
Answer Text
Via a JSP or Servlet
Using ASP
Using CGI (Common Gateway Interface)
As a built in library / module
Question
Comments in your PHP
Answers
Correct
Answer Text
Should be used, but sparsley - if you have a lot of them, they'll have a significant effect on the bandwidth of your server
Should be avoided if at all possible, but you might occasionally use them during development to leave a reminder for yourself of work that's still to be done before your program gets released into a production environment.
Should be used liberally to help anyone who has to read your program at a later date understand how it works
Question
what's the result of 1 + 2 * 3 + 4
Answers
Correct
Answer Text
11
15
21
Question
Which of the following is not a valid variable name?
Answers
Correct
Answer Text
$number-in-class
$number_in_class
$NumberInClass
Question
To access a form variable from the following PHP page (recent versions), you should
Answers
Correct
Answer Text
Use a $ in front of the name of the field on the form
Use a variable of the form $_REQUEST[xxxxx] where xxxxx is the name of the field
call the getpost() function, and look up the value in the returned array
Access it via $env("xxxxx") where xxxxx is the name of the field
Question
PHP statements are usually teminated by
Answers
Correct
Answer Text
A full stop character
A closing brace "}"
A semicolon character
Question
In PHP, the word "bgcolor" is used as
Answers
Correct
Answer Text
a special variable
a function
it has no special use
an operator
Question
In PHP, the word "and" is used as?
Answers
Correct
Answer Text
an operator
a function
it is reserved, but unused
a special variable
Question
You'll use a loop in your PHP program
Answers
Correct
Answer Text
To repeat a piece of code or HTML a number of times
To slow down your response to the user so that he has time to read the answers that you're sending him
To make the code look more complicated for security purposes
Question
PHP stands for Prety Hot Property
Answers
Correct
Answer Text
True
False
Answer
Test Statistics
Rating
Likes
3
Negative
1
Your Actions
Rate
Up
Down
Published In…
Everything PHP
Open Source
PHP and MySQL