My original string looks like this
value='' tabindex='500'
I would like to replace the string with this
value='Email:' tabindex='500' onclick=\"if (this.value=='Email:') {this.value='';}
So I use this str_replace function
$userForm = str_replace("value='' tabindex='500'", "value='Email:' tabindex='500' onclick=\"if (this.value=='Email:') {this.value='';}\"",$userForm);
My output ends up being this
value="" tabindex="500" onfocus=" if (this.value == '') { this.value = ''; }"
If you notice, everything except for the parts that include 'value="Email:" are replaced correctly...
I was hoping someone might have an idea on why this is happening? Any help would be greatly appreciated. Thank you in advance!