adding + sign in every space in a string inphp code example Example: dot after each character php $formatted = trim( chunk_split($password, 1, ' ') );