varExport() static public method

The type of the values determines the output, it can be one of the following. - boolean, becomes \c true or \c false - null, becomes \c null - string, adds \ (backslash) to backslashes, double quotes, dollar signs and newlines. Then wraps the whole string in " (double quotes). - numeric, displays the value as-is. - array, expands all value recursively using this function - object, creates a representation of an object creation if the object has \c serializeData implemented.
static public varExport ( $value )
コード例 #1
0
 function storeCacheFile($filepath, $transformationData, $extraCode, $type, $charsetName)
 {
     $file = basename($filepath);
     $dir = dirname($filepath);
     $php = new eZPHPCreator($dir, $file);
     $php->addComment("Cached transformation data");
     $php->addComment("Type: {$type}");
     $php->addComment("Charset: {$charsetName}");
     $php->addComment("Cached transformation data");
     $php->addCodePiece('$data = ' . eZCharTransform::varExport($transformationData) . ";\n");
     $php->addCodePiece("\$text = strtr( \$text, \$data['table'] );\n");
     if ($extraCode) {
         $php->addCodePiece($extraCode);
     }
     return $php->store(true);
 }