Showing posts with label php test. Show all posts
Showing posts with label php test. Show all posts

php test upwok answers

php test upwok answers

1. Which of the following will start a session?

Answers:

• session(start);
• session();
• session_start();
• login_sesion();



2. Which of the following is incorrect with respect to separating PHP code and HTML?

Answers:

• Use an MVC design pattern.
• As PHP is a scripting language, HTML and PHP cannot be separated.
• Use any PHP template engine e.g: smarty to keep the presentation separate from business logic.
• Create one script containing your (PHP) logic outputting XML and one script produce the XSL to translate the XML to views.

2. Which of the following will read an object into an array variable?

Answers:

• $array_variable = get_object_vars($object);
• $array_variable = (array)$object;
• $array_variable = array $object;
• $array_variable = get_object_vars $object;