U.S. Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Zend 200-710 Exam - Topic 4 Question 88 Discussion

Given a php.ini setting ofdefault_charset = utf-8what will the following code print in the browser?header('Content-Type: text/html; charset=iso-8859-1');echo '✂✔✝';
A) Three Unicode characters, or unreadable text, depending on the browser
B) ✂✔✝
C) A blank line due to charset mismatch

Zend 200-710 Exam - Topic 4 Question 88 Discussion

Actual exam question for Zend's 200-710 exam
Question #: 88
Topic #: 4
[All 200-710 Questions]

Given a php.ini setting of

default_charset = utf-8

what will the following code print in the browser?

header('Content-Type: text/html; charset=iso-8859-1');

echo '✂✔✝';

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

0/2000 characters
Evette
6 months ago
Wait, so it could print unreadable text? That's wild!
upvoted 0 times
...
Rikki
6 months ago
Totally agree, A is the right choice!
upvoted 0 times
...
Mose
7 months ago
I think it might actually be B, though.
upvoted 0 times
...
Aleisha
7 months ago
Not sure about A, could be a blank line instead.
upvoted 0 times
...
Thurman
7 months ago
A will print the characters if the browser supports it.
upvoted 0 times
...
Teddy
7 months ago
I thought that if the charset doesn't match, it might just print the HTML entities as text, so maybe option B?
upvoted 0 times
...
Casie
8 months ago
I'm not entirely sure, but I feel like the output could be the Unicode characters or something strange, depending on the browser's handling of the charset.
upvoted 0 times
...
Aretha
8 months ago
I remember practicing a similar question where charset mismatches led to unreadable text. Could it be option A?
upvoted 0 times
...
Stephaine
8 months ago
I think the `header` function sets the content type to ISO-8859-1, which might cause issues with the UTF-8 characters.
upvoted 0 times
...
Lanie
8 months ago
I'm pretty confident I know the answer to this one. The Unicode characters will display as unreadable text in the browser because the charset specified in the header() function doesn't match the default charset set in the php.ini file.
upvoted 0 times
...
Heike
8 months ago
Okay, I think I've got this. The php.ini setting of default_charset = utf-8 means that any text output will be in UTF-8 by default. But the header() function is overriding that and setting the charset to iso-8859-1. So the Unicode characters will likely not display correctly.
upvoted 0 times
...
Shenika
9 months ago
Hmm, I'm a bit confused by this. The question is asking about the interaction between the php.ini setting and the header() function, right? I'll need to make sure I understand that properly.
upvoted 0 times
...
Stefan
9 months ago
This looks like a tricky one. I'll need to think carefully about how the charset settings interact with the output.
upvoted 0 times
...
Edelmira
1 year ago
I'm going with B. The header function clearly specifies ISO-8859-1, so the Unicode characters should display correctly. Easy peasy!
upvoted 0 times
Mignon
12 months ago
User4: Easy peasy!
upvoted 0 times
...
Emiko
1 year ago
User3: So, the Unicode characters should display correctly.
upvoted 0 times
...
Peggie
1 year ago
User2: I agree, the header function specifies ISO-8859-1.
upvoted 0 times
...
Evangelina
1 year ago
User1: I think it will display three Unicode characters.
upvoted 0 times
...
...
Serita
1 year ago
Woah, this question is really testing our understanding of character encoding. I hope the exam has more questions about emojis and cat pictures, that would be much easier!
upvoted 0 times
...
Cheryl
1 year ago
Hold on, isn't the PHP.ini setting of 'default_charset = utf-8' just a default? Wouldn't the 'header()' function take precedence and override that?
upvoted 0 times
Kerry
12 months ago
B) The 'header()' function will override the default charset setting
upvoted 0 times
...
Sabina
12 months ago
B) ✂✔✝
upvoted 0 times
...
Nieves
12 months ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
...
Alethea
1 year ago
Hmm, I'm not sure. Wouldn't the charset mismatch cause a blank line? The browser might not know how to handle the Unicode characters.
upvoted 0 times
Kristian
1 year ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
Winfred
1 year ago
B) ✂✔✝
upvoted 0 times
...
Eun
1 year ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
...
Lorriane
1 year ago
The output will definitely be the three Unicode characters, regardless of the browser. That's the correct answer, right?
upvoted 0 times
Lindsay
1 year ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
Miss
1 year ago
The output will definitely be the three Unicode characters, regardless of the browser. That's the correct answer, right?
upvoted 0 times
...
Ena
1 year ago
B) ✂✔✝
upvoted 0 times
...
Ronnie
1 year ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
Maryann
1 year ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
Carlota
1 year ago
B) ✂✔✝
upvoted 0 times
...
Torie
1 year ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
...
Renay
1 year ago
I agree with Rickie, it might not display correctly because of the charset difference.
upvoted 0 times
...
Rickie
1 year ago
I believe it will show unreadable text due to charset mismatch.
upvoted 0 times
...
Whitley
1 year ago
I think it will print three Unicode characters.
upvoted 0 times
...

Save Cancel