Deal of The Day! Hurry Up, Grab the Special Discount - Save 25%
- Ends In
00:00:00
Coupon code:
SAVE25
X
Welcome to Pass4Success
Login
|
Sign up
-
Free
Preparation Discussions
Mail Us
support@pass4success.com
Location
US
MENU
Home
Popular vendors
Salesforce
Microsoft
Nutanix
Amazon
Google
CompTIA
SAP
VMware
Fortinet
PeopleCert
Eccouncil
HP
Palo Alto Networks
Adobe
ServiceNow
Dell EMC
CheckPoint
Linux Foundation
Discount Deals
New
About
Contact
Login
Sign up
Home
Discussions
Zend Discussions
Exam 200-710 Topic 2 Question 37 Discussion
Zend Exam 200-710 Topic 2 Question 37 Discussion
Actual exam question for Zend's 200-710 exam
Question #: 37
Topic #: 2
[All 200-710 Questions]
Given a PHP value, which sample shows how to convert the value to JSON?
A
$string = json_encode($value);
B
$string = Json::encode($value);
C
$json = new Json($value); $string = $json->__toString();
D
$value = (object) $value; $string = $value->__toJson();
Show Suggested Answer
Hide Answer
Suggested Answer:
B
by
Tiera
at
Oct 14, 2022, 11:17 AM
Limited Time Offer
25%
Off
Get Premium 200-710 Questions as Interactive Web-Based Practice Test or PDF
Contribute your Thoughts:
Submit
Cancel
Rickie
23 days ago
I wonder if option D involves turning the value into a Transformer first, and then converting it to JSON. Probably best to keep it simple with json_encode().
upvoted
0
times
Viola
2 days ago
A) $string = json_encode($value);
upvoted
0
times
...
...
Trina
26 days ago
If I see 'Json' with a capital 'J', I automatically assume it's not the standard PHP function. json_encode() all the way!
upvoted
0
times
...
Lynda
1 months ago
Converting the value to an object and then calling a custom __toJson() method? That's just weird. json_encode() is the way to go.
upvoted
0
times
Delbert
8 days ago
Yeah, json_encode() is the standard way to convert PHP values to JSON.
upvoted
0
times
...
Laurel
8 days ago
B) $string = Json::encode($value);
upvoted
0
times
...
Lili
15 days ago
A) $string = json_encode($value);
upvoted
0
times
...
Brynn
16 days ago
Yeah, json_encode() is definitely the way to go.
upvoted
0
times
...
Ashlee
18 days ago
A) $string = json_encode($value);
upvoted
0
times
...
...
Natalie
1 months ago
Creating a new Json object and then converting it to a string? That seems overly complicated. I'll stick with the simple json_encode() method.
upvoted
0
times
Angella
1 days ago
A) $string = json_encode($value);
upvoted
0
times
...
Kristeen
7 days ago
I agree, json_encode() is much simpler.
upvoted
0
times
...
Simona
18 days ago
A) $string = json_encode($value);
upvoted
0
times
...
...
Brice
2 months ago
Option B looks like it might be a custom function, but I'm not familiar with it. I'll go with the built-in json_encode() function.
upvoted
0
times
Whitley
29 days ago
Yeah, json_encode() is a built-in function for converting PHP values to JSON.
upvoted
0
times
...
Clarinda
1 months ago
I agree, json_encode() is the way to go.
upvoted
0
times
...
...
Dylan
2 months ago
The correct answer is A. json_encode() is the standard PHP function to convert a value to JSON.
upvoted
0
times
Adrianna
1 days ago
Yes, that's correct. json_encode() is the way to go.
upvoted
0
times
...
Nichelle
21 days ago
A) $string = json_encode($value);
upvoted
0
times
...
...
Kattie
2 months ago
I'm not sure, but I think B) $string = Json::encode($value); could also be a valid option.
upvoted
0
times
...
Chan
2 months ago
I agree with Tonette, json_encode is the right function to convert PHP value to JSON.
upvoted
0
times
...
Tonette
2 months ago
I think the correct answer is A) $string = json_encode($value);
upvoted
0
times
...
Log in to Pass4Success
×
Sign in:
Forgot my password
Log in
Report Comment
×
Is the comment made by
USERNAME
spam or abusive?
Commenting
×
In order to participate in the comments you need to be logged-in.
You can
sign-up
or
login
Save
Cancel
Rickie
23 days agoViola
2 days agoTrina
26 days agoLynda
1 months agoDelbert
8 days agoLaurel
8 days agoLili
15 days agoBrynn
16 days agoAshlee
18 days agoNatalie
1 months agoAngella
1 days agoKristeen
7 days agoSimona
18 days agoBrice
2 months agoWhitley
29 days agoClarinda
1 months agoDylan
2 months agoAdrianna
1 days agoNichelle
21 days agoKattie
2 months agoChan
2 months agoTonette
2 months ago