Write one:
Class personage
{
public $ str
Functional personnel (str)
{
$ this-& gt; str = $ str
}
Common fun
Write one:
Class personage
{
public $ str
Functional personnel (str)
{
$ this-& gt; str = $ str
}
Common function name ($len)
{
$ n = substr($ this-& gt; str,0,$ len);
echo $ n;
Returns $ n;;
}
}
$ product = new person (iconv ("UTF-8 ","GBK ","A Duo Guliqi Haha Lavasha "));
$ product-& gt; Name (8); //Output "A Duo Guli" after execution (each Chinese character occupies two bytes).