Is there a function in PHP that takes in a string, a number (i), and a character (x), then replaces the character at position (i) with
i
x
implode(':', str_split('1300', 2));
returns:
13:00
Also very nice for some credit card numbers like Visa:
implode(' ', str_split('4900000000000000', 4));
4900 0000 0000 0000
str_split — Convert a string to an array