PHP Syntax
| 26. | Which of the following is used to include a PHP file in another PHP file in PHP? |
|---|
A. require('filename.php');
B. include('filename.php');
C. require_once('filename.php');
D. all of the above
View Answer Discuss Work SpaceAnswer: option d
Explanation:
all of the above are used to include a PHP file in another PHP file in PHP.
| 27. | Which of the following is used to redirect the user to another page in PHP? |
|---|
A. header('Location: new_page.php');
B. redirect('new_page.php');
C. location('new_page.php');
D. none of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
header('Location: new_page.php'); is used to redirect the user to another page in PHP.
| 28. | Which of the following is used to set a cookie in PHP? |
|---|
A. setcookie('cookie_name', 'cookie_value');
B. cookie('cookie_name', 'cookie_value');
C. create_cookie('cookie_name', 'cookie_value');
D. all of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
setcookie('cookie_name', 'cookie_value'); is used to set a cookie in PHP.