PHP string str_pad() Function4 Sept 2024 | 2 min read The 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 |
PHP String function The is one of the most popular functions of PHP, which is widely used to convert the string into uppercase. It takes a string as a parameter and converts all lowercase English character of that string to uppercase. Other characters such as...
2 min read
PHP String Function The is predefined PHP function. It is used to return parses input from a string according to a format. If we will pass two parameters in the function, the data will be returned as an array. Related Function: print(): It is used for output...
1 min read
PHP function PHP function is predefined function. It is used to calculate the metaphone key of a string. It is useful to text search and text matching application. It is phonetic algorithm developed by Lawrence Philips. The algorithm produces variable length keys as output. Syntax: string metaphone (...
1 min read
PHP Function The is predefined function of PHP. It is used to find the length of initial segment or returns the number of characters including whitespaces found in a string. Note: This function is binary-safe. Syntax: strcspn(string,char,start,length); Parameter Description Required/Optional String Specify the string to search. Required Char Specifies the characters to search for. Required Start Specify where...
1 min read
PHP Function The is predefine function of PHP. It is used to remove backslashes and clean up data retrieved from a database or from an HTML form. It returns a string with backslashes stripped off. This function is important while we need to remove the...
1 min read
PHP implode() is a string function, which joins the array elements in a string. It is a binary-safe function. In implode() function, parameters can be passed in any order. The implode() function works same as the join() function and returns a string created from the elements...
2 min read
PHP string Function PHP string is predefined function. It is used to replace some character with some other characters. It is case-insensitive version of str_replace(). Note: This function is binary-safe. Syntax: str_ireplace(find,replace,string,count); Parameter Description Required/Optional find Specify the value to find. Required replace Specify the value to replace. Required string Specify the string to be searched Required Count It is variable that...
1 min read
PHP Function PHP function is important function, which is used to output one or more string. Note: The function is not actually a function, so there is no required to use parentheses. Syntax: int print ( string $arg ); Parameter Description Required/Optional string Specify one or more string to be sent output. Required Example...
1 min read
PHP explode() is a string function, which splits a string by a string. In simple words, we can say that it breaks a string into an array. The explode() function has a "separator" parameter, which cannot contain an empty string, because it holds the original...
3 min read
PHP String Function The is an in-built string function of PHP. It is used to display the array values as a formatted string according to the format. The main purpose of this function is to display a formatted string. PHP 4 and above versions supports...
3 min read
We request you to subscribe our newsletter for upcoming updates.
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