FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


totally screwed by this unbeliaveable strange string!





Mgccl
ok... I'm totally SCREWED by this script... I tired everything for 8 HOURS and this is still giving me errors like CRAZY



Code:
<?php
$count = 1;
$i = 0;
while($i < $count){
   $str_expected[$i] = '$expected["'.$i.'"] = 1/(1+pow(10, (func_math_mean_array($array';
   $str_expected[$i] .= ') - $elo['.$i.'])/400));';
echo $str_expected[$i].'<br>';
echo '$expected["0"] = 1/(1+pow(10, (func_math_mean_array($array) - $elo[0])/400));<br>';

//test see if it's true
if ($str_expected[$i] == '1/(1+pow(10, (func_math_mean_array($array) - $elo[0])/400));') {
   echo 'true';
}

$i++;
}
?>

I mean in what way does this SCRIPT never echos TRUE! I mean... look at the result THE RESULT IS AMAZINGLY CALLING the word SAME!
THE HELL IS WRONG WITH PHP! GOD! it was include in a big script! I used 8 hours to find out this freaken thing is screwing with me by using unexplainable way!
what the hell it WRONG...
soory for the extreme expression of my emotion...
any one can answer me plz... it's the 1st time I get screwed by PHP so much...
hexkid
Mgccl wrote:
ok... I'm totally SCREWED by this script...

[...]

Code:
<?php
// ...
//test see if it's true
if ($str_expected[$i] == '1/(1+pow(10, (func_math_mean_array($array) - $elo[0])/400));') {
   echo 'true';
}
//...
?>
[...]

$str_expected starts with "$expected..."; you're comparing it with "1/(1+pow(...", of course it will never print "true"!

You have to change your if() to
Code:
if ($str_expected[$i] == '$expected["0"] = 1/(1+pow(10, (func_math_mean_array($array) - $elo[0])/400));') {
   echo 'true';
}
snowboardalliance
Can I ask what this scirpt is supposed to do?
It really looks like a pretty big, complicated thing to just make a long seemingly useless string.
Mgccl
it is useless...
but I have find the problem now....
thx anyway
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.