taith
Members-
Posts
1,514 -
Joined
-
Last visited
Everything posted by taith
-
if you put em into an array, and natsort() them... the bottom one'd be your highest #
-
yup! md5() is "not" decyrptable... well... not in any standard method... lol
-
how bout this? <?php $fdeck = array("2-H","3-H","4-H","5-H","6-H","7-H","8-H","9-H","10-H","11-H","12-H","13-H","14-H","2-D","3-D","4-D","5-D","6-D","7-D","8-D","9-D","10-D","11-D","12-D","13-D","14-D","2-S","3-S","4-S","5-S","6-S","7-S","8-S","9-S","10-S","11-S","12-S","13-S","14-S","2-C","3-C","4-C","5-C","6-C","7-C","8-C","9-C","10-C","11-C","12-C","13-C","14-C"); $drawn=array(); for($i=0; $i<=4; $i++){ $new=$fdeck[array_rand($fdeck)]; if(!in_array($new,$drawn)) $drawn[]=$new; else $i--; } ?>
-
agreed... thats tripple posting there! calm down... bump your other post if it gets lost and unsolved...
-
really? musta missed that... THANKS!
-
cant remove spaces from string extracted from array
taith replied to jb60606's topic in PHP Coding Help
$arr = file('data/symbols.dat'); foreach($arr as $k=>$v){ $arr[$k]=trim($v); } $sym = implode('+', $arr); -
well... if you highlight_string() it automatically outputs it to the browser, so you have to ob_start()/ob_get_contents()/ob_end_clean() to get it into a string... i just want a function that does that without being tempermental... lol
-
with $_POST/$_GET variables... you almost always want to make them more safe... so... i subscribe to this school of thought <?php $go = htmlentities($_POST['the']); if ($go==1){ ...code to excute } ?> in the long run... its really down to the programmer...what works for you... and including the ()'s on print/echo... really arnt necessary... people use em... but i dont see a point in em... just making your code harder to read :-)
-
also... you need your exit; command after the header...
-
anyone know/have a function lik highlight_string(), that doesnt require/need you to ob_start() to get the info into a string?
-
cURL(), file_get_contents(), http://ca.php.net/manual/en/ref.xml.php
-
you'd need to shuffle the arrays... as is... it only grabs the first matching pair...
-
personally... i just switched from notepad... to notepad++... was a good change... havent found any faults with it as of yet :-) but you wouldnt catch me dead using other programs(dreamweaver, etc...)
-
as stated before... since it is on a random based principal... it may time out before it finds it... i uploaded the same on my server... finds in FAR less then a second... (if you want to see http://www.divinedesigns.ca/test/)
-
unless... if you grab all 5 variables at the same time <?php $array1=array("67","134","46","82","39"); $array2=array("88","165","50","79","190","146"); $array3=array("109","100","70","103","54","52","150","81"); $array4=array("61","118","55","97","112","138","85","124","73","127"); $array5=array("147","106","37","155","43","115","130"); while($all!=484){ $numbers[1]=$array1[array_rand($array1)]; $numbers[2]=$array2[array_rand($array2)]; $numbers[3]=$array3[array_rand($array3)]; $numbers[4]=$array4[array_rand($array4)]; $numbers[5]=$array5[array_rand($array5)]; $all=array_sum($numbers); } print_r($numbers); ?> that'll prolly speed it up a bit...?
-
more then likely... thats not your issue... put exit; after it... it'll prolly stop... then continue down the file again...
-
yes... however, since it grabs them sequentially, it'd be next to impossible to blacklist em...
-
that is of course assuming it doesnt try the same combination twice... lol
-
did you print_r($numbers);? whats the error?
-
i can garantee your parser engine wont like you very much... but how bout somin like this? $array1=array("67","134","46","82","39"); $array2=array("88","165","50","79","190","146"); $array3=array("109","100","70","103","54","52","150","81"); $array4=array("61","118","55","97","112","138","85","124","73","127"); $array5=array("147","106","37","155","43","115","130"); $numbers=array(); while($all!=484 && count($numbers)!=5){ if(count($numbers)==0){ $numbers[]=$array1[array_rand($array1)]; $all+=$array1[array_rand($array1)]; }elseif(count($numbers)==1){ $numbers[]=$array2[array_rand($array2)]; $all+=$array2[array_rand($array2)]; }elseif(count($numbers)==2){ $numbers[]=$array3[array_rand($array3)]; $all+=$array3[array_rand($array3)]; }elseif(count($numbers)==4){ $numbers[]=$array4[array_rand($array4)]; $all+=$array4[array_rand($array4)]; }elseif(count($numbers)==5){ $numbers[]=$array5[array_rand($array5)]; $all+=$array5[array_rand($array5)]; } if(count($numbers)==5 && $all!=484){ $numbers=array(); $all=0; } } not tested...
-
no prob *pats himself on the back*
-
strip_tags() ;-)
-
if(!function_exists(makecomma)){ function makecomma($input){ if(strlen($input)<=3) return $input; $length=substr($input,0,strlen($input)-3); $formatted_input = makecomma($length).",".substr($input,-3); return $formatted_input; } }
-
nope... makecomma() function is defined in the body of that page...