I'm sure there's better ways than the following but with understanding the basic functions and logic you can become creative with many ways to a solution.
PHP Code:
stock PlaceCharInfrontOfAllCharsInString(String:input[512], char thechar)
{
new maxlen = (strlen(input) * 2) + 1;
if(maxlen > 512)
return;
decl String:temp[512];
for(int i = 0;i<strlen(input);i++)
Format(temp, sizeof(temp), "%s%c%c", temp, thechar, input[i]);
Format(input, 512, "%s", temp);
}
PHP Code:
decl String:test[512] = "abcde fgh";
PlaceCharInfrontOfAllCharsInString(test, '1');
PrintToServer(test);
Note: I'm sure Format isn't meant to use a function argument variable to write to its own buffer variable and has undefined behavior and may be exploitable or cause memory corruption within the destination string.
__________________