I'm running in errors in my PHP script, I used to have my server on cPanel but switched over to Plesk. While on cPanel I had no issues but on Plesk I keep running into issues.
We are currently running PHP 5.6
Error:
Parse error: syntax error, unexpected ']', expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\Inetpub\vhosts\retroleads.com\httpdocs\wp\data.php on line 8
Source:
<?php
$iterator = new FilesystemIterator("C:\Inetpub\vhosts\retroleads.com\wp\");
$filter = new RegexIterator($iterator, '/.(csv)$/');
$filelist = array();
foreach($filter as $entry) {
    $filelist[] = $entry->getFilename();
}
foreach($filelist as $filelist){
    $open = fopen($filelist, "r") or die("Unable to open file!");
    //Loop through the CSV rows.
    while (($row = fgetcsv($open, 0, ",")) !== FALSE) {
    //Dump out the row for the sake of clarity.
    //var_dump($row);
        //run cURL for postback
        // create curl resource 
        $ch = curl_init(); 
        //check for underscores
        if (preg_match('/_/', $row[3])) {
            //explode the string
            $row[3] = explode("_", $row[3]);
            $row[3] = $row[3][1];
        }else{
            $row[3] == $row[3];
        }
        // set url 
        curl_setopt($ch, CURLOPT_URL, "http://tracking.retroleads.com/advBack.php?click_id={$row[3]}"); 
        //return the transfer as a string 
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
        // $output contains the output string 
        $output = curl_exec($ch); 
        // close curl resource to free up system resources 
        curl_close($ch);
    }
}
?>
 
    