Is there an algorithm for declining FI. On PHP to the genital case?
naschal algorithms of Full name, but not in the parental case or not for PHP. Ideally, there are better 2 different solutions (easier and more complicated).
Answer 1, Authority 100%
I am also interesting to me. copied the first code, add from the bottom:
$ r = new nclnamecaseru ();
$ R- & GT; SetlastName ('Skorevan');
$ r - & gt; setfirstname ('Rafael');
$ R- & GT; SetFatherName ('Mikelelangelovich');
$ R- & GT; SETGENDER (1);
Echo $ R- & GT; GetFormatted (2);
Similarly: Cherepanshina Rafael Malelenevich.
Answer 2, Authority 100%
Encoding the class file must be in ANSI.
Class We call as follows:
include ("nclnamecaseru.php");
$ r = new nclnamecaseru ();
$ R- & GT; SetfirstName (ICONV ('CP1251', 'UTF-8', 'Ivan'));
$ R- & GT; SETLASTNAME (ICONV ('CP1251', 'UTF-8', 'Ivanov'));
$ R- & GT; SetFATHERNAME (ICONV ('CP1251', 'UTF-8', 'Ivanovich'));
$ R- & GT; SETGENDER (0);
Echo Iconv ('UTF-8', 'CP1251', $ R- & GT; GetFormatted (2));
Provided that the document is called by the class in CP1251 encoding. Verified, everything works!