$inputArray = array()
→Defines a PHP array $inputArray, using the array() function to initialize it.
json_encode($inputArray, JSON_PRETTY_PRINT)
→The json_encode() function to convert the PHP array $inputArray to JSON format.
print($encodedJSON)
→This line outputs the JSON string encoded by json_encode()
Answer is correct.
// first configure array
$InputArray = array(......);
// json_encode function... the format is json_encode(name of the array)
$encodedJSON = json_encode($InputArray, JSON_PRETTY_PRINT);
//Finally print
Print ($encodedJSON)
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Alondrix
Highly Voted 1 year, 3 months agomiknotna
Most Recent 2 days, 11 hours agoislam215
3 months, 3 weeks agochiacche
5 months ago[Removed]
8 months, 2 weeks agoIgorLVG
11 months, 2 weeks agoshefo1
1 year, 2 months agostudying_1
1 year, 3 months agommt1mmt1
1 year, 3 months agostudying_1
1 year, 3 months ago