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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.