Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 497 Bytes

0402.md

File metadata and controls

23 lines (18 loc) · 497 Bytes

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$padSTR_PAD_LEFT);
  • A) 005
  • B) 500
  • C) 000
  • D) 30000
Answer

Answer: A