fork download
  1. <?php
  2. $text='А роза упала на лапу Азора';
  3. $result='палиндром';
  4.  
  5. $arr1=explode('',$text);
  6. for ($i=0;$i<count($arr1);$i++){
  7. if ($arr1[$i]!==' ') {
  8. $arr1[$i]=strtolower($arr1[$i]);
  9. } else {unset($arr1[$i]);}
  10. }
  11.  
  12. $arr2=$arr1;
  13. $condition=true;
  14. for ($j=0,$i=count($arr1)-1;$i>0;$i--,$j++){
  15. if ($arr1[$i]!=$arr2[$j]){
  16.  
  17. $condition=false;
  18. }
  19. }
  20.  
  21. if ($condition==true) {echo "" . $result;
  22.  
  23. } else {echo "Not" . $result;}
  24.  
  25. ?>
Success #stdin #stdout #stderr 0s 82560KB
stdin
Standard input is empty
stdout
палиндром
stderr
PHP Warning:  explode(): Empty delimiter in /home/7N0ZYr/prog.php on line 8