National_Instruments
200-500 · Question #150
What is the output of the following code? str_pad('PHP', 10, 'P', STR_PAD_BOTH);
The correct answer is C. PPPPHPPPPP. See the full explanation below for the reasoning.
Question
What is the output of the following code? str_pad('PHP', 10, 'P', STR_PAD_BOTH);
Options
- AH
- BPHPPPPPPPP
- CPPPPHPPPPP
- DPPPPPPPPHP
How the community answered
(46 responses)- A11% (5)
- B7% (3)
- C80% (37)
- D2% (1)
Community Discussion
No community discussion yet for this question.