<<< Previous question <<< Question ID#0402.md >>> Next question >>>
The str_pad() function is used pad a string to a given length using another string. What is the output of the following PHP script?
$number = 5;
$len = 3;
$pad = '0';
echo str_pad($number, $len, $pad, STR_PAD_LEFT);
- A) 005
- B) 500
- C) 000
- D) 30000
Answer
Answer: A