The funny thing is, I've been working on this on my computer through localhost. It works perfectly fine. Then I copied the same exact code to GoDaddy and suddenly it doesn't work.
Here is my code:
<?php
include ('simple_html_dom.php');
$html = file_get_html('http://www.tibia.com/community/?subtopic=worlds&world=Aurora');
$table = $html->find('table[class=Table2]')[0];
for ($i = 0; $i < 20; $i++)
{
$player = $table->find('tr[class=Even]')[$i]->find('a')[0];
echo $player->href . '<br>';
$html2 = file_get_html($player->href);
$date = $html2->find('[@id="characters"]/div[5]/div/div/table[3]/tbody/tr[2]/td[1]')[0];
echo $date . '<br>';
$dateArr = explode(" ", $date);
echo $dateArr . '<br>';
echo count($dateArr[0]);
//for ($k = 0; count($dateArr[0]); $k++)
//{
// echo $dateArr[0][$k] . '<br>';
//}
}
?>
Here is the exact error:
Parse error: syntax error, unexpected '[' in /home/content/27/11250627/html/tibia/pvplist.php on line 6