public static function toggleFlagGetState($file, $id) {

        static::checkFile($file, $toWrite = true);

        $content = file_get_contents($file);

        $id = preg_quote($id, '#');

        preg_match("#/\*$id\*/!!([0|1])#", $content, $match);

        if (isset($match['1'])) {
            return !!intval($match['1']); // return state of flag
        }

        return null; // no flag in file
    }
public static function toggleFlagGetState($file, $id) {

        static::checkFile($file, $toWrite = true);

        $content = file_get_contents($file);

        $id = preg_quote($id, '#');

        preg_match("#/\*$id\*/!!([0|1])#", $content, $match);

        if (isset($match['1'])) {
            return !!intval($match['1']); // return state of flag
        }

        return null; // no flag in file
    }
public static function toggleFlagGetState ( $ file , $ id ) { static :: checkFile ( $ file , $ toWrite = true ) ; $ content = file_get_contents ( $ file ) ; $ id = preg_quote ( $ id , '#' ) ; preg_match ( "#/\*$id\*/!!([0|1])#" , $ content , $ match ) ; if ( isset ( $ match [ '1' ] ) ) { return ! ! intval ( $ match [ '1' ] ) ; // return state of flag } return null ; // no flag in file }
Return state of flag
@param string $file
@param string $id
@return bool|null - null: no flag, true: flag is on, false: flag is off
Return state of flag