NEW
Font size
WorksheetsPHP hypertext preprocessor
Total questions: 20
Worksheet time: 4mins
Which of the following array represents an array with strings as index?
Numeric Array
Associative Array
Multidimentional Array
PHP server scripts are surrounded by delimiters, which?
What are the two types of array in php
Indexed, sequence
Associative, sequence
Indexed, associative
None
How do you write "Hello World" in PHP
Document.Write("Hello World");
"Hello World";
echo "Hello World";
1. All variables in PHP start with which symbol?
$
!
&
What does PHP stands for?
PHP: Hypertext Preprocessor
Private Home Page
Personal Hypertext Processor
PHP is a____________side scripting language
server
browser
client
Which one of these variables has an illegal name?
$my-Var
$myVar
$my_Var
How do you create an array in PHP?
$cars = "Volvo", "BMW", "Toyota";
$cars = array["Volvo", "BMW", "Toyota"];
$cars = array("Volvo", "BMW", "Toyota");
Which of the following is not true?
PHP can be used to develop web applications.
PHP makes a website dynamic
PHP can not be embedded into html.
Find the output
<?php
$x = 5;
{ $x = 10;
echo $x;
}
echo $x;
?>
105
510
1010
find the output
<?php
$x = 1;
$x += 1;
echo $x;
?>
2
1
0
_______ is a concatenation operator in php
+ (plus)
+=
. (dot)
The default file extension for PHP files is __________.
.html
.php
.css
.java
The 2 basic ways to get output in PHP are __________.
echo and cout
echo and scan
echo and print
What will be the output of the following program?
<?php $var1 = "Hello"; $var2 = "World"; echo "$var1$var2"; ?>
HelloWorld
"$var1$var2"
Hello World
None of the above
What is the step to create database?
Open localhost/phpmyadmin/
Open NetBeans/New Project/
Open browser/Notepad++
<?php $fruits = array ("apple", "orange", array ("pear", "mango"),"banana");
echo (count($fruits, 1)); ?>
What is the output of the php code?
5
4
6
3
Who is the father of PHP?
Drek Kolkevi
Willam Makepiece
List Barely
Rasmus Lerdorf
Choose the equivalent of the statement : $sub -= $sub.
$sub = $sub - 1
$sub = $sub - $sub
$sub = $sub - $sub -1
$sub = - $sub
