LocaleModel::writeDefinitions PHP Méthode

writeDefinitions() public static méthode

Write a locale's definitions to a file.
public static writeDefinitions ( resource $fp, array $Definitions )
$fp resource The file to write to.
$Definitions array The definitions to write.
    public static function writeDefinitions($fp, $Definitions)
    {
        // Write the definitions.
        uksort($Definitions, 'strcasecmp');
        $LastC = '';
        foreach ($Definitions as $Key => $Value) {
            // Add a blank line between letters of the alphabet.
            if (isset($Key[0]) && strcasecmp($LastC, $Key[0]) != 0) {
                fwrite($fp, "\n");
                $LastC = $Key[0];
            }
            $Str = '$Definition[' . var_export($Key, true) . '] = ' . var_export($Value, true) . ";\n";
            fwrite($fp, $Str);
        }
    }