How do you allow the caller to submit a variable number of arguments to a function?

How do you allow the caller to submit a variable number of arguments to a function?A . Using a prototype like function test( ... $parameters).B . Using a prototype like function test() and the function func_get_args() inside the function body.C . Using a prototype like function test($parameters[]).D . Using a...

August 8, 2018 No Comments READ MORE +

Which of the following is used to find all PHP files under a certain directory?

Which of the following is used to find all PHP files under a certain directory?A . PHPlteratorB . RecursiveTreelteratorC . RecursiveDirectorylteratorD . SplTempFileObjectView AnswerAnswer: C

August 7, 2018 No Comments READ MORE +

What is the output of the following code?

What is the output of the following code? $first= "second"; $second = "first"; echo $$$first;A . "first"B . "second"C . an empty stringD . an errorView AnswerAnswer: B

August 6, 2018 No Comments READ MORE +

Which PHP function is used to validate whether the contents of $_FILES['name']['tmp_name'] have really been uploaded via HTIP?

Which PHP function is used to validate whether the contents of $_FILES['name']['tmp_name'] have really been uploaded via HTIP?View AnswerAnswer: is_uploaded_file(), is_uploaded_file

August 3, 2018 No Comments READ MORE +

What is the output of the following code?

What is the output of the following code? class C { public $x = 1; function _construct() { ++$this->x;} function _invoke() { return ++$this->x; } function _toString() { return (string) --$this->x;} $obj = new C(); echo $obj();A . 0B . 1C . 2D . 3View AnswerAnswer: D

August 2, 2018 No Comments READ MORE +

What is the output of the following code?

What is the output of the following code? class Test { public function _call($name, $args) { call_user_func_array(array('static', "test$name"), $args); } public function testS($1) { echo "$1,"; class Test2 extends Test { public function testS($1) { echo "$1,$1,"; } $test = new Test2(); $test->S('A');A . A,B . A,A,C . A,A,A,D ....

August 2, 2018 No Comments READ MORE +

What is the name of the method that can be used to provide read access to virtual properties in a class?

What is the name of the method that can be used to provide read access to virtual properties in a class?A . _call()B . _get()C . _set()D . _wakeup()E . _fetch()View AnswerAnswer: B

August 2, 2018 No Comments READ MORE +

What is the output of the following code?

What is the output of the following code? echo '1' . (print '2') + 3;A . 123B . 213C . 142D . 214 E: Syntax errorView AnswerAnswer: D

August 2, 2018 No Comments READ MORE +

Given a DateTime object that is set to the first second of the year 2014, which of the following samples will correctly return a date in the format '2014-01-0100:00:01'?

Given a DateTime object that is set to the first second of the year 2014, which of the following samples will correctly return a date in the format '2014-01-0100:00:01'?A . $datetime->format{'%Y-%m-%d %h:%i:%s')B . $datetime->format{'%Y-%m-%d %h:%i:%s', array('year', 'month', 'day', 'hour', 'minute', 'second'))C . $datetime->format('Y-m-d H:i:s')D . $date= date('Y-m-d H:i:s', $datetime);View AnswerAnswer:...

August 1, 2018 No Comments READ MORE +

What is the pattern modifier for handling UTF-8 encoded preg_ * functionality?

What is the pattern modifier for handling UTF-8 encoded preg_ * functionality?A . eB . uC . PHP does not support UTF-8 encoded stringsD . A pattern modifier is not neededView AnswerAnswer: B

July 31, 2018 No Comments READ MORE +