Which of the following PHP functions can be used to set the HTTP response code? (Choose 2)
Suggested Answer: B, D
Get Premium 200-710 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
20 comments · newest first
MI
Minna
10 months ago
Header_add? That's not even a thing!
EI
Eileen
10 months ago
Surprised that people still confuse these functions!
ES
Estrella
11 months ago
No way, it's just B and D!
MA
Man
11 months ago
I think C is a valid option too.
SE
Sean
11 months ago
Definitely B and D!
ME
Melissa
12 months ago
I can't recall `header_add()` or `http_header_set()` being used for setting response codes, but I'm a bit confused about `http_set_status()`.
DE
Dell
12 months ago
I feel like I've seen a question like this before, and I think `header()` and `http_response_code()` were the correct answers.
CH
Christiane
1 year ago
I'm not so sure about `http_set_status()`, but `http_response_code()` sounds familiar as a function that can be used for this purpose.
LE
Leandro
1 year ago
I think I remember that the `header()` function is definitely one of the options for setting the HTTP response code.
JE
Jettie
1 year ago
The `header()` function is the one I'm most familiar with for setting the response code. I'll go with that and `http_response_code()` as my two choices.
PA
Paris
1 year ago
I'm a bit confused by the options here. I'll need to review my notes on HTTP response codes and PHP functions to figure this one out.
VE
Veronica
1 year ago
Ah, I remember learning about the `header()` function in my PHP class. That's definitely one of the correct answers.
CH
Christiane
1 year ago
Hmm, I think `http_response_code()` is also a valid option for setting the response code. I'll double-check the documentation to be sure.
CA
Caitlin
1 year ago
I'm pretty sure the `header()` function is used to set the HTTP response code, but I'm not sure about the other options.
HE
Hermila
1 year ago
I think the answer is D) http_response_code()
SH
Shantay
1 year ago
B) header() is the correct function to set the HTTP response code. I use it all the time in my projects.
CO
Corrinne
10 months ago
Both are great for setting response codes.
AN
Anabel
10 months ago
D) is also valid! I use it frequently.
VI
Vicente
11 months ago
What about D) http_response_code()?
VA
Vanesa
11 months ago
I agree, B) header() is essential.