Web Hosting Talk







View Full Version : export me please


ti_nhatrang
09-22-2009, 04:36 PM
Hi guys,

Am trying to have my script run the codes I have individually and out put me the ones that has the word "patent", and if it doesn't, then skip it or something, please help... am almost done with my project.



<?php

$code=”011869,0118658,011654";
$dp = "http://www.google.com/search?hl=en&source=hp&q="$code[]"

$sp = @file_get_contents($dp);
if ($sp === FALSE) {
echo("<P>Error: unable to read the URL $dp. Process aborted.</P>");
exit();
}

preg_match_all("(Patent)", $sp, $content);

foreach($content[0] as $route) {
echo $code,'<br />';
}
?>

XSAndy
09-22-2009, 05:03 PM
Its not very clear what you are trying to do.

ti_nhatrang
09-22-2009, 05:27 PM
im just trying to see the code numbers I have in the variable, that's an array actually... if good has a result, the first one with the word "patent", I want this script to output the code that has the patent word as the result... that is all...

mattle
09-23-2009, 08:52 AM
Hi guys,


$code="011869,0118658,011654";
$dp = "http://www.google.com/search?hl=en&source=hp&q="$code[]"


(please use the PHP tags for PHP code...)

You have some serious syntax issues going on in line 2 here...does this even get past the parser?

ti_nhatrang
09-23-2009, 05:41 PM
no it doesn't was looking for some help...

Exoware
09-23-2009, 06:46 PM
You can start by trying to explain exactly what it is you're trying to do. Please be as detailed as you can.