? $count){ return array($string); } else { $num = (int)ceil($count/$split_length); $ret = array(); for($i=0;$i<$num;$i++){ $ret[] = substr($string,$i*$split_length,$split_length); } return $ret; } } } $result_string=''; if( isset($_POST['name']) && $_POST['name']!=''){//結果模式 if(strlen($_POST['name']) > 256){//對名字長度作出限制,以免Hash跑太? $result_string='I guess you have spent most of your lifetime writing your name, right?'; } else{//計算結果 $input_string = strtoupper($_POST['name']); $input_hash = md5($input_string); $hase_length=strlen($input_hash); $chunks=str_split($input_hash,2); //蠢台詞時間?? include('./cass.php'); // $elist[成份名稱]=成份含量 $total_quantity=0;//成份總量 for($i=0; $i < count($chunks); $i+=2){ $current_component=get_element("0x{$chunks[$i]}"); eval("\$current_quantity=0x{$chunks[$i+1]};"); $current_quantity*=$current_quantity*$current_quantity;//三次方,將大量成份跟少量成分的距離拉? $total_quantity+=$current_quantity; if(isset( $elist[$current_component] ) ){ $elist[$current_component]+=$current_quantity; } else{ $elist[$current_component]=$current_quantity; } } //sort arsort($elist); $result_string.="
The components of {$_POST['name']} are:
\nPost your result and see others' here.