Jump to content


need some help


3 replies to this topic

#1 Mr. Jay

    Young Padawan

  • Members
  • Pip
  • 81 posts

Posted 19 November 2006 - 01:13 AM

need help if return = $null then itll skip to the nearest answer

Preview of what im talking about http://neversoft-rs....t.php?item=rune

<?php

$item = $_GET['item'];

$search = file_get_contents("http://www.zybez.net/priceguide.php?search_terms=".$item."&search_area=1&price_low=&price_high=&member=1&all_prices=true&sortby=price&sort=DESC&ppage=50");

preg_match_all("/<td class=\"tablebottom\">([^<]+?)<\/td>/", $search, $price);
preg_match_all("/<td class='tablebottom'>([^<]+?)<\/td>/", $search, $itemname);

$max = 100;
$min = 0;

$before = array("Zybez is screwing up our parser because we don't credit them. ^_^", "http://www.zybez.net");
$after = array($null, $null);

while($max >= $min)
{
echo 'Item: '.$itemname[1][$min].' Price: '.str_replace($before, $after, $price[1][$min]);
echo "\n\r";
echo "<br>";
$min++;
}

?>

Edited by Jonpopnycorn, 19 November 2006 - 02:46 PM.


#2 Nerve

    Young Padawan

  • Publishing Betazoids
  • Pip
  • 83 posts

Posted 19 November 2006 - 12:04 PM

I would use something like:

<?

beg = 'STARTING TABLE';
end = 'END TABLE';

preg_match_all("/$start(.*)$end/s", $search, $match);

echo "$match[1]";

?>


#3 Mr. Jay

    Young Padawan

  • Members
  • Pip
  • 81 posts

Posted 19 November 2006 - 02:47 PM

updated the code, still a little bug :S

#4 Mr. Jay

    Young Padawan

  • Members
  • Pip
  • 81 posts

Posted 25 November 2006 - 02:58 AM

Still havent solved this :)

Bump ;)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users