Jump to content

[SOLVED] searching


-entropyman

Recommended Posts

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.

<?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.

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!!

 

:D

 

 

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.