I'm trying to replace the first character of a string with words, but I'm running into some trouble here. I'm only able to replace the character with the first character of the string, and not the entire string. How would I fix this?
$type = "xgo xgo xgo";
$ifX = $type[0];
if ($ifX == "x") {
$type[0] = "do not ";
}
Result:
dgo xgo xgo
Want Result:
do not go xgo xgo