I use this code for encrypt and decrypt string.
but this code create question mark
$key="123456789098776545433322";
$test=mcrypt_ecb (MCRYPT_3DES, $key, 'test', MCRYPT_ENCRYPT);
$result=mcrypt_ecb (MCRYPT_3DES, $key, $test, MCRYPT_DECRYPT);  
<input type="text"     value="<?=$result?>"   name="test">
result is
test����
