简体   繁体   English

我简单的php代码有什么问题?

[英]What is wrong with my simple php code?

<?php
function hash($val, $key){
    $chrs = explode($val, "");
    for($c=0; $c<count($chrs); $c++){
          $ascii[$c]=ord($chrs[$c]);
    }
    $digi = explode($key,"");
    for($c=0; $c<count($digi); $c++){
        $nascii[$c]= $ascii[$c]+$digi[$c];
        $fhash[$c] = $nascii[$c];
    }
}
?>

error:Fatal error: Cannot redeclare hash() in /Applications/XAMPP/xamppfiles/htdocs/hash.php on line 12 错误:致命错误:无法在第12行的/Applications/XAMPP/xamppfiles/htdocs/hash.php中重新声明hash()

hash() is already a PHP inbuilt function. hash()已经是PHP的内置函数。 Name your function to something else. 将函数命名为其他名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM