jonsjava Posted July 20, 2008 Share Posted July 20, 2008 mine already has it saved, so it should be a matter of having this: <?php $image = 'http://xx.x.xx.xx/######.png'; $server = 'http://xx.x.xx.xx/xxxxxxx.htm'; $number = basename($image, ".png"); $ns = file_get_contents($server); $data_array = explode("\n", $ns); $result_array = array(); $count = 0; foreach ($data_array as $value){ if (strstr($value, $number)){ $result_array[] .= $value; $count++; } } if ($count = 0){ print "failed to find number"; } } if ($count != 0){ $final_result = $result_array[0]; } else { $final_result = null; } print $final_result; //$final_result contains the data you want. Quote Link to comment Share on other sites More sharing options...
-entropyman Posted July 20, 2008 Author Share Posted July 20, 2008 not working jon, it's not printing. any ideas? oh and yours was the one that worked before. Quote Link to comment Share on other sites More sharing options...
jonsjava Posted July 20, 2008 Share Posted July 20, 2008 <?php $image = 'http://xx.x.xx.xx/######.png'; $server = 'http://xx.x.xx.xx/xxxxxxx.htm'; $number = basename($image, ".png"); $ns = file_get_contents($server); $data_array = explode("\n", $ns); $result_array = array(); $count = 0; foreach ($data_array as $value){ if (strstr($value, $number)){ $result_array[] .= $value; $count++; } } if ($count == 0){ print "failed to find number"; $final_result = "NOTHING FOUND!"; } } if ($count != 0){ $final_result = $result_array[0]; } print $final_result; //$final_result contains the data you want. Quote Link to comment Share on other sites More sharing options...
-entropyman Posted July 20, 2008 Author Share Posted July 20, 2008 odd i'm still getting blank page. hmm any ideas? the other code worked but as i look at it again it prints "Found 0 results" maybe its the count? thank you for your help btw. any ideas mate ??? Quote Link to comment Share on other sites More sharing options...
-entropyman Posted July 20, 2008 Author Share Posted July 20, 2008 Nevermind got it to work! Turns out there was just an extra } in the code that was ending the code early. Thank you to everyone!! Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 20, 2008 Share Posted July 20, 2008 Nevermind got it to work! Turns out there was just an extra } in the code that was ending the code early. Thank you to everyone!! They ain't extra they are there to make sure you read what we post. Half the time I'l spell stuff wrong just to see if ppl read it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.