function loopThroughKeywords($runDepth)
{
    global $runDepth, $arrKeywords;
    foreach ($arrKeywords as $keyword) {
        //echo 'status keyword: '.$statusKeyword;
        //echo $runDepth;
        loopThroughPages($runDepth, $keyword);
    }
}
//$setTermAutoRun = "month + day";
// export als Json om, om te zetten naar html preview, excel export of samenvoegen met GA data?
// ! Stats to compare by date of year, weekday of month, weekday of month per year, per hour per month, per hour per weekday , ...
//scrape top 10 google op keyword
// ! check keywords per keywords per site
// ! check land per land > ook taal per taal?
$depth = $arrData[$selectedClient]['depth'];
echo 'depth uit arrData: ' . $depth . "\n";
$endDepth = $arrDepth[$depth];
echo 'depth uit arrDepth: ' . $endDepth . "\n";
if ($endDepth == '0') {
    $runDepth = $endDepth;
} else {
    for ($i = 0; $i < $endDepth + 1; $i += 10) {
        $runDepth = $i;
        loopThroughPages($runDepth);
    }
}
function loopThroughPages($runDepth)
{
    global $arrKeywords, $CCTLD, $keyword, $lng, $url, $statusKeyword;
    foreach ($arrKeywords as $keyword) {
        //echo 'status keyword: '.$statusKeyword;
        print_r($arrKeywords);
        if ($statusKeyword == '0') {
            x($CCTLD, $keyword, $lng, $url, $runDepth);
        } else {
            $arrKeywords = array_shift($arrKeywords);
            break;
        }
    }