PHP string str_pad() FunctionThe str_pad() is in-built PHP function which is use to pad a string to a certain length. It returns input string padded on the left, right both sides to the specified function. Syntax:
Note 1: The pad-string may be reduced if the padding character can't be divided by the pad_string's length.Note 2: If the pad_type is not specified then it assumed as STR_PAD_RIGHT.Example 1Output: Your string isHello Javatpoint By using str_pad() function;Hello Javatpoint..... Example 2Output: Your string is:Javatpoint By using str_pad() function:Javatpoint Example 3Output: Your string isHello Javatpoint By using str_pad() function:.....Hello Javatpoint Example 4Output: Your string is: Javatpoint By using str_pad() function: Javatpoint............ Example 5Output: Your string isHello Javatpoint By using str_pad() function:..Hello Javatpoint.. Next TopicPHP String |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India