Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

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
3 months ago
Wait, so it could print unreadable text? That's wild!
upvoted 0 times
...
Rikki
3 months ago
Totally agree, A is the right choice!
upvoted 0 times
...
Mose
4 months ago
I think it might actually be B, though.
upvoted 0 times
...
Aleisha
4 months ago
Not sure about A, could be a blank line instead.
upvoted 0 times
...
Thurman
4 months ago
A will print the characters if the browser supports it.
upvoted 0 times
...
Teddy
4 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
5 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
5 months ago
I remember practicing a similar question where charset mismatches led to unreadable text. Could it be option A?
upvoted 0 times
...
Stephaine
5 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
5 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
5 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
6 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
6 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
10 months 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
9 months ago
User4: Easy peasy!
upvoted 0 times
...
Emiko
9 months ago
User3: So, the Unicode characters should display correctly.
upvoted 0 times
...
Peggie
9 months ago
User2: I agree, the header function specifies ISO-8859-1.
upvoted 0 times
...
Evangelina
10 months ago
User1: I think it will display three Unicode characters.
upvoted 0 times
...
...
Serita
10 months 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
11 months 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
9 months ago
B) The 'header()' function will override the default charset setting
upvoted 0 times
...
Sabina
9 months ago
B) ✂✔✝
upvoted 0 times
...
Nieves
9 months ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
...
Alethea
11 months 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
10 months ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
Winfred
10 months ago
B) ✂✔✝
upvoted 0 times
...
Eun
10 months ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
...
Lorriane
11 months ago
The output will definitely be the three Unicode characters, regardless of the browser. That's the correct answer, right?
upvoted 0 times
Lindsay
9 months ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
Miss
9 months ago
The output will definitely be the three Unicode characters, regardless of the browser. That's the correct answer, right?
upvoted 0 times
...
Ena
9 months ago
B) ✂✔✝
upvoted 0 times
...
Ronnie
9 months ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
Maryann
10 months ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
Carlota
10 months ago
B) ✂✔✝
upvoted 0 times
...
Torie
10 months ago
A) Three Unicode characters, or unreadable text, depending on the browser
upvoted 0 times
...
...
Renay
11 months ago
I agree with Rickie, it might not display correctly because of the charset difference.
upvoted 0 times
...
Rickie
12 months ago
I believe it will show unreadable text due to charset mismatch.
upvoted 0 times
...
Whitley
12 months ago
I think it will print three Unicode characters.
upvoted 0 times
...

Save Cancel