← All docs

array_pad()

Pads an array to the specified length with a value.

array_pad()

function array_pad(array $array, int $length, mixed $value): array

Pads an array to the specified length with a value.

Parameters:

  • $array (array)
  • $length (int)
  • $value (mixed)

Returns: array

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how array_pad is implemented in the compiler, see the internals page.