PHP Screening

PHP Screening

published on January 21, 2011165 responses 0

PHP server scripts are surrounded by delimiters, which?

<?php>...</?>
<script>...</script>
<?php…?>

What is the correct way to include the file "time.inc" ?

<!--include file="time.inc"-->
<?php require("time.inc"); ?>
<?php include_file("time.inc"); ?>

What is the correct way to connect to a MySQL database?

mysql_open("localhost");
connect_mysql("localhost");
mysql_connect("localhost");

Which of the following regular expressions will match the string no.no.no?

no*no*no*
\.\..\.\..\.\.
..\...\...
no?no?no

What library do you need in order to process images?

GIF/PNG library
GD library
c-client library
Image Library

What is the problem with <?=$expression ?> ?

There is no problem
This syntax doesn't even exist It requires a special PHP library that may not always be available
It requires short tags and this is not compatible with XML

All variables in PHP start with which symbol?

!
$
&
#

What does this function do: <?php function my_func($variable) {return (is_numeric($variable) && $variable % 2 == 0);}?>

tests whether $variable is a number and ends in 2
tests whether $variable is a number and contains 2
tests whether $variable is an even number
tests whether $variable ends in 2

What does PHP stand for?

How do you write "Hello World" in PHP

In PHP, arrays may be sorted with which of the following functions?

uksort()
arsort()
ksort()
All of the above

Are objects passed by value or by reference?

What is the difference between $message and $$message?

What is the difference between characters \023 and \x23?

With a heredoc syntax, do I get variable substitution inside the heredoc contents?