fork(1) download
  1. <?php
  2.  
  3.  
  4.  
  5. $text = "Я иду съ мечемъ судия";
  6. $result = "палиндром";
  7.  
  8. $text = str_replace(' ', '', mb_strtolower($text));
  9.  
  10. $length = mb_strlen($text);
  11.  
  12. if (mb_substr($text, ($length / 2), $length) == mb_substr($text, -($length / 2) - 1, $length))
  13. echo $result;
  14. else echo "Не палиндром";
Success #stdin #stdout 0.01s 24420KB
stdin
Standard input is empty
stdout
палиндром