Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP how to echo multiple output
    primarykey
    data
    text
    <p>I am a newbie in programming and in need of help with PHP. I have a code that is use to decrypt a string. The problem is it only show the decrypted first variable in the function(decriptInfoDetails). What need to be change so it can also shows the 2nd and 3rd variable in the function? Also is there a better way of doing this for example if I have more variable to decrypt say 10 or more? I attach the code below for viewing purpose. Hope somebody can help this newbie, and thanks in advance.</p> <pre><code> &lt;? $privateKey = "xxxxx"; $iv = "xxxxx"; $keyPassword = "xxxxx"; $ivPassword = "xxxxx"; function decriptInfoDetails($ciphertext_base64){ global $privateKey,$iv; $ciphertext_dec = trim(base64_decode($ciphertext_base64)); $plaintext_utf8_dec = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $privateKey, $ciphertext_dec, MCRYPT_MODE_CBC, $iv); return trim($plaintext_utf8_dec); } function encPass($ciphertext_base64){ global $keyPassword,$ivPassword; $ciphertext_dec = trim(base64_decode($ciphertext_base64)); $plaintext_utf8_dec = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $keyPassword, $ciphertext_dec, MCRYPT_MODE_CBC, $ivPassword); return trim($plaintext_utf8_dec); } function encAndDecPass($data){ global $keyPassword,$ivPassword; $encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $keyPassword, $data, MCRYPT_MODE_CBC, $ivPassword); $ciphertext_base64 = trim(base64_encode($encrypted)); return trim($ciphertext_base64); } echo decriptInfoDetails("D8D6OsHciT/rBfeNMGrwtQZegzDv02dTnotroNOe+Kk=","ojPlxa16CVhoLq8GP8d0h5l+Z+5GqFXSWXaX7GSXC/Q=1","zrJCOomZ4CJIeBTomAb9OGq2pQK17FBGqVNFdVawPB8=1"); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload