fork download
  1. <?php
  2.  
  3.  
  4. $text = "А роза упала на лапу Азора";
  5. $result = "Является полиндромом";
  6. $textWithoutSpace = str_replace(" ", "", $text);
  7. $textLower = mb_strtolower($textWithoutSpace);
  8. $lenghtText = mb_strlen($textLower);
  9. $halfOfLenght = floor($lenghtText/2);
  10. for ($i=0;$i<=$halfOfLenght;$i++)
  11. {
  12. if ($textLower[$i] != $textLower[$lenghtText-$i]){
  13. $result = "Не является полиндромом";
  14. break;
  15. }
  16. }
  17. echo $result;
Runtime error #stdin #stdout #stderr 0s 82560KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Uncaught Error: Call to undefined function mb_internal_encoding() in /home/2w854y/prog.php:4
Stack trace:
#0 {main}
  thrown in /home/2w854y/prog.php on line 4