Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 561 Bytes

0425.md

File metadata and controls

25 lines (21 loc) · 561 Bytes

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