fork download
  1. <?php
  2.  
  3. class Upload
  4. {
  5. public $name = 'аплоад';
  6. }
  7.  
  8. $upload = new Upload();
  9.  
  10. $rus=array('А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П','Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Э','Ю','Я','а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п','р','с','т','у','ф','х','ц','ч','ш','щ','ъ','ы','ь','э','ю','я',' ');
  11. $lat=array('a','b','v','g','d','e','e','gh','z','i','y','k','l','m','n','o','p','r','s','t','u','f','h','c','ch','sh','sch','y','y','y','e','yu','ya','a','b','v','g','d','e','e','gh','z','i','y','k','l','m','n','o','p','r','s','t','u','f','h','c','ch','sh','sch','y','y','y','e','yu','ya','-');
  12.  
  13. $upload->name = str_replace($rus, $lat, $upload->name);
  14. var_dump($upload);
Success #stdin #stdout 0.01s 24400KB
stdin
Standard input is empty
stdout
object(Upload)#1 (1) {
  ["name"]=>
  string(6) "apload"
}