nerdexam
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)
  • A
    11% (5)
  • B
    7% (3)
  • C
    80% (37)
  • D
    2% (1)

Community Discussion

No community discussion yet for this question.

Full 200-500 Practice