Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension - strpad #21

Open
WengerK opened this issue May 14, 2018 · 0 comments · May be fixed by #24
Open

Extension - strpad #21

WengerK opened this issue May 14, 2018 · 0 comments · May be fixed by #24

Comments

@WengerK
Copy link
Member

WengerK commented May 14, 2018

Something such as


  /**
   * Mimic str_pad.
   *
   * @param string $number
   *   The number.
   * @param int $pad_length
   *   The pad length.
   * @param string $pad_string
   *   The string.
   *
   * @return string
   *   Return the padded string
   */
  public function strpad($number, $pad_length = 2, $pad_string = "0") {
    return str_pad($number, $pad_length, $pad_string, STR_PAD_LEFT);
  }

@WengerK WengerK linked a pull request May 17, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant