title: How do I encrypt a string in PHP?
body: <p>I want to make an encryption function that should have some secret key. Something like the following:</p>
  
  <pre><code>function encrypt($string) {
      $key = "mastermind";
      $enc = encryptfunc($string, $key);
  
      return $enc;
  }
  </code></pre>
  
  <p>The same thing should apply for decryption.</p>