str_repeat()
Concatenate repetitions of a string to compose a new string.
Syntax
str_repeat (string, number, [separator])
Parameter
Parameter | Definition |
---|---|
string | string to be repeatedly concatenated to compose new string |
number | number of repetitions of string |
separator | separator string to insert between repetitions |
Description
This function will concatenate a specified string to itself with an optional separator for a specified number of times.
This function returns a string containing the specified number of concatenations of the specified string with separator string between repetitions.
This function does not set the PSL errno variable.
Example
The following is an example of the strcasecmp() function:
#Make a test list of 15 comma-separated words
str="TEST";
test_list = str_repeat(str, 15, ", ");
print ("Test list: " . test_list . "\n");
str="TEST";
test_list = str_repeat(str, 15, ", ");
print ("Test list: " . test_list . "\n");
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*