Chaitanya Lakshmi
  • About Me
  • Job Duties
  • Knowledge Blog
  • Applications
  • Contact Us
    • Linked In
    • Facebook
  • About Me
  • Job Duties
  • Knowledge Blog
  • Applications
  • Contact Us
    • Linked In
    • Facebook

How can a script come to a clean termination?

2/27/2012

0 Comments

 
  • When exit() is called
  • When the execution reaches the end of the current file
  • When PHP crashes
  • When Apache terminates because of a system problem
  • I don’t know
Answer:
When exit() is called

0 Comments

How does the identity operator === compare two values?

2/27/2012

0 Comments

 
  • It converts them to a common compatible data type and then compares the resulting values
  • It returns True only if they are both of the same type and value
  • If the two values are strings, it performs a lexical comparison
  • It bases its comparison on the C strcmp function exclusively
  • It converts both values to strings and compares them
  • I don’t know
Answer:
It returns True only if they are both of the same type and value

0 Comments

Run-time inclusion of a PHP script is performed using the ________ construct, while compile-time inclusion of PHP scripts is performed using the _______ construct.

2/27/2012

0 Comments

 
  • include_once, include
  • require, include
  • require_once, include
  • include, require
  • All of the above are correct
  • I don’t know
Answer:
All of the above are correct
0 Comments

What is the best way to iterate through the $myarray array, assuming you want to modify the value of each element as you do?

2/27/2012

3 Comments

 
<?php
$myarray = array ("My String",
"Another String",
"Hi, Mom!");
?>


  • Using a for loop
  • Using a foreach loop
  • Using a while loop
  • Using a do…while loop
  • There is no way to accomplish this goal
  • I don’t know
Answer:
Using a foreach loop

3 Comments

Which language construct can best represent the following series of if conditionals?

2/27/2012

0 Comments

 
<?php
if($a == 'a') {
    somefunction();
} else if ($a == 'b') {
   anotherfunction();
} else if ($a == 'c') {
   dosomething();
} else {
   donothing();
}
?>


  • A switch statement without a default case
  • A recursive function call
  • A while statement
  • It is the only representation of this logic
  • A switch statement using a default case
  • I don’t know
Answer:
A switch statement using a default case

0 Comments

What is the difference between print() and echo()?

2/27/2012

1 Comment

 
  • print() can be used as part of an expression, while echo() can’t
  • echo() can be used as part of an expression, while print() can’t
  • echo() can be used in the CLI version of PHP, while print() can’t
  • print() can be used in the CLI version of PHP, while echo() can’t
  • There’s no difference: there are alias
  • I don’t know
Answer:
print() can be used as part of an expression, while echo() can’t

1 Comment

The date() function returns ______________.

2/27/2012

1 Comment

 
  • An integer
  • A floating-point number
  • An array
  • A string
  • None of the above
  • I don’t know
Answer:
A String
1 Comment

What does the built-in delete function do?

2/27/2012

0 Comments

 
  • It deletes a file
  • It deletes a directory
  • It unsets a variable
  • It removes a database row
  • This function does not exist!
  • I don’t know
Answer:
It deletes a file

0 Comments

What happens if you add a string to an integer using the + operator?

2/27/2012

0 Comments

 
  • The interpreter outputs a type mismatch error
  • The string is converted to a number and added to the integer
  • The string is discarded and the integer is preserved
  • The integer and string are concatenated together in a new string
  • The integer is discarded and the string is preserved
  • I don’t know
Answer:
The string is discarded and the integer is preserved

0 Comments

What will be the output of the following script?

2/27/2012

0 Comments

 
<?php
$s = '12345';
$s[$s[1]] = '2';
echo $s;
?>


  • 12345
  • 12245
  • 22345
  • 11345
  • Array
  • I don’t know
Answer:
12245

0 Comments
<<Previous
Forward>>

    Author

    Write something about yourself. No need to be fancy, just an overview.

    Archives

    February 2012

    Categories

    All
    General
    Krds
    Phponweb

    RSS Feed

Powered by Create your own unique website with customizable templates.