This might look as a stupid question. But, I have a class with some public string variables defined in it.
Upon assigning a value to a property:
$a = new user();
$a->FirstName = "sth";
I want to store the value as UTF8.
I know I can do this via:
$a->Firstname = utf8_encode("sth");
However, I want the object to do this automatically.
How can I do this?
utf8_encodedoes? It very specifically converts ISO-8859-1 strings to UTF-8. How can you guarantee that all strings you want to store in this object will be ISO-8859-1 encoded?