fork(2) download
  1. <?php
  2.  
  3.  
  4. $text = "Аргентина любит негра";
  5. $result= "Палиндром";
  6. $result2= "Не палиндром";
  7. $text = mb_strtolower($text);
  8.  
  9. $text = str_replace(" ","",$text);
  10.  
  11. $length = mb_strlen($text);
  12. $halfLength = floor($length/2);
  13. for ($i=0; $i==$halfLength; $i++) {
  14. $o=-$i-1;
  15. $comparison1=mb_substr($text,$i,1);
  16. $comparison2=mb_substr($text,$o,1);
  17. echo "$comparison1 \n";
  18. echo "$comparison2 \n";
  19. }
  20.  
Success #stdin #stdout 0.02s 24400KB
stdin
Standard input is empty
stdout
Standard output is empty