menu

PHP Syntax

PHP Syntax - Important Points


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

Discuss Work Space

Answer: 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

Discuss Work Space

Answer: 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

Discuss Work Space

Answer: option a

Explanation:

setcookie('cookie_name', 'cookie_value'); is used to set a cookie in PHP.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now