Sunday, 8 July 2012

Introduction :


If you have any problem related  to programming 
(C / C++ / JAVA(core) / PHP / MySQL).
You can share your problem with me,I will try to work on your problem and give result as soon  as possible.





Working as a Web Developer
Er. Kanhaiya Lal (B.Tech-CSE-2011) 




Palindrome In PHP : kanhaiya lal (08/07/2012)

Source Code :=>
<?php

  $x="madam";                 //Input String
  checkPalindrom($x);  //function Calling
  function checkPalindrom($x) //function Definition
 {
       $len=strlen($x);  //get String Length
       $p=substr($x,0,1);    //get First Char
       $q=substr($x,$len-1,$len);  //get Last char
          if($p===$q)
      {
           if($x!=' ' && strlen($x)!=0)
          {
              $x=substr($x,1,$len-2); //get String with Remove first & last char of New String. 
             checkPalindrom($x);
          }
          else
              echo "True,It's Palindrome.";
      }
      else
     {
            die("No,It's not Palindrome.");  
     }
 }
?>


Output :=>


    True,It's Palindrome.