猿问

我希望你能帮助我,以便我可以在 php 中将一个 md5 函数与一个字符串变量连接起来

我希望你能帮助我,以便我可以将一个 md5 函数与一个字符串变量连接起来


 <?php  

 function Crypter ()

 {

   $string ="";

   $string1=md5( $string );


  }  

  ?>  


繁花如伊
浏览 97回答 2
2回答

慕容森

您没有将字符串传递给您的函数,因此实际上没有什么可散列的(MD5 是一种散列方法,而不是加密)。做你问的事情也几乎没有意义:)function Crypter ($string2hash) {&nbsp; &nbsp; return $string2hash . md5(string2hash);}&nbsp;&nbsp;

潇湘沐

使用点连接运算符:<?php&nbsp;&nbsp;&nbsp;function Crypter ()&nbsp;{&nbsp; &nbsp;$string ="";&nbsp; &nbsp;$string1=md5( $string );&nbsp; &nbsp;return $string . $string1;&nbsp; }&nbsp;&nbsp;&nbsp; ?>
随时随地看视频慕课网APP
我要回答