<<< Previous question <<< Question ID#0425.md >>> Next question >>>
What value should be assigned to $format to ensure the following script outputs 250007? It must use the d formatter.
$number1 = 250;
$number2 = 7;
$format = '???';
echo sprintf($format, $number1);
echo sprintf($format, $number2);
// output is 250007
Do not include quotes
- A) "%1$03d"
- B) 0
- C) an error
- D) it is imposible
Answer
Answer: A