Monday, December 31, 2018

php - Use of undefined constant j - assumed 'j'

Im creating a scrapping code that scrap each Address in a specific suburbs. but im stuck in this problem; " Use of undefined constant j - assumed 'j'" and it identified in $target_url can anyone help me this problem?



$arr = array("Illawong 2232",
"Strathfield 2135",
"Croydon 2132",
"Croydon Park 2133",
"Burwood 2134",

"Parramatta 2150",
"Hurtsville 2220",
"Seven Hills 2153",
"Blacktown 2148",
"Toongabie 2146",
"Winston Hills 2153",
"Bondi Beach 2026",
"Bondi Junction 2022",
"Coogee 2034",
"Pymble 2073",

"Miranda 2228",
"Caringbah 2229",
"Sylvania 2224",
"Drummoyne 2047",
"Concord 2137"
);
$counter = count($arr);
for($j=0;$j<$counter; $j++)
{


$arr2 = array("list-1", "list-2", "list-3","list-4", "list-5");
$count = count($arr2);

for($i=0;$count>$i;$i++)
{

//scrapping starts here
$target_url = "http://www.xxxxxxxxx.com.au/buy/".$arr[j]."/".$arr2[i]."?includeSurrounding=false";
$html = new simple_html_dom();




$html->load_file($target_url);

foreach($html->find('a[class=name]') as $vcard)
{
echo $vcard. "
"
}
}
}

No comments:

Post a Comment

plot explanation - Why did Peaches&#39; mom hang on the tree? - Movies &amp; TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...