Assigning browser cookies for A-B testing
That code, without indentation, is a chore to read.  The same code, with just indentation and whitespace changes, is easier to follow.

// AB testing code starts;
$abTestValues = array(1,1,0,1);
$abTestValue = 0;
$abTestCurrentValue = $abTestValues[$abTestValue];
$cookieName = 'ab-ranking-20160301';
$cookieLifeTime = time() + (86400 * 30);
$cookiePath = "/";
$abTestCookieValue = $_COOKIE[$cookieName];
if (trim($abTestCookieValue) != '' &amp;&amp; $abTestCookieValue != null) {
    $abTestCurrentValue = $abTestCookieValue;
} else {
    $abTestFile = 'abranking.txt';
    if (is_file($abTestFile)) {
        $abTestLastValue = file_get_contents($abTestFile);
        if (($abTestLastValue + 1) == sizeof($abTestValues)) {
            $abTestValue = 0;
        } else {
            $abTestValue = $abTestLastValue + 1;
        }
        $abTestCurrentValue = $abTestValues[$abTestValue];
    }
    file_put_contents($abTestFile, $abTestValue);
    $ranking_cookieval = $abTestCurrentValue;

    setcookie($cookieName, $abTestCurrentValue, $cookieLifeTime, $cookiePath); //cookie set for 30 day
}
// AB testing code ends;