title: PHP encrypt - and decrypt otherthan base64 encode
body: <p>In one of our web application ( in PHP, MySQL ) we are saving user's mobile number as encrypted value and decrypt it when we send SMS to them. The application was pretty working well. But</p>
  
  <p>now GoDaddy removed the option base64_encode and decode. So that we cant send SMS to users. So we revert back the mobile numbers to its normal state running it locally.</p>
  
  <p>My question is which is the easiest and safe way to encrypt and decrypt a string using a key.</p>
  
  <p>Something like</p>
  
  <pre><code>Normal string : 9876543210  -&gt; After encrypt with a key -&gt; AASASOOPFPOEROP45664654456
  Encrypted string : AASASOOPFPOEROP45664654456 -&gt; on decrypt -&gt; 9876543210 
  </code></pre>
  
  <p>My current code </p>
  
  <pre><code>function encodeString($str){
    for($i=0; $i&lt;5;$i++)
    {
      $str=strrev(base64_encode($str)); //apply base64 first and then reverse the string
    }
    return $str;
  }
  
  
  function decodeString($str){
   for($i=0; $i&lt;5;$i++)
   {
      $str=base64_decode(strrev($str)); //apply base64 first and then reverse the string}
   }
   return $str;
  }
  </code></pre>
  
  <p>Please help me . Thanks in advance</p>