title: PHP Openssl Encrypt Data For URL
body: <p>I have this code :</p>
  
  <pre><code>&lt;?php
  
  $key = 'thisisakey';
  $iv = '1234567812345678';
  
  $plaintext = 'Hello World';
  
  $ciphertext = openssl_encrypt($plaintext,  'AES-128-CBC', $key, OPENSSL_RAW_DATA, $iv);
  echo $ciphertext . '&lt;br&gt;';
  
  $plaintext  = openssl_decrypt($ciphertext, 'AES-128-CBC', $key, OPENSSL_RAW_DATA, $iv); 
  echo $plaintext . '&lt;br&gt;';
  
  ?&gt;
  </code></pre>
  
  <p>The idea behind this code was encrypt the data to be used on the URL. So, I'm expecting output which URL friendly. I mean, it contains alpha-numeric characters only. But when I use this <code>openssl_encrypt</code> function, I got weird characters, which I don't think URL friendly.</p>
  
  <p>it produces output like this :</p>
  
  <pre><code>^‘-7È¾®l¿ô¾áÙ
  </code></pre>
  
  <p>how to generate URL friendly characters from <code>openssl_encrypt</code>? thank you</p>