本文整理汇总了PHP中ew_Convert函数的典型用法代码示例。如果您正苦于以下问题:PHP ew_Convert函数的具体用法?PHP ew_Convert怎么用?PHP ew_Convert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ew_Convert函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_unique_filename
protected function get_unique_filename($name, $type, $index, $content_range)
{
if (EW_UPLOAD_CONVERT_ACCENTED_CHARS) {
$name = htmlentities($name, ENT_COMPAT, "UTF-8");
$name = preg_replace('/&([a-zA-Z])(uml|acute|grave|circ|tilde|cedil);/', '$1', $name);
$name = html_entity_decode($name, ENT_COMPAT, "UTF-8");
}
$name = ew_Convert("UTF-8", EW_FILE_SYSTEM_ENCODING, $name);
return parent::get_unique_filename($name, $type, $index, $content_range);
}
示例2: ew_SaveFile
function ew_SaveFile($folder, $fn, $filedata)
{
$fn = ew_Convert(EW_ENCODING, EW_FILE_SYSTEM_ENCODING, $fn);
$res = FALSE;
if (ew_CreateFolder($folder)) {
if ($handle = fopen($folder . $fn, 'w')) {
// P6
$res = fwrite($handle, $filedata);
fclose($handle);
}
if ($res) {
chmod($folder . $fn, EW_UPLOADED_FILE_MODE);
}
}
return $res;
}
示例3: AddField
function AddField($name, $value)
{
if (is_null($value)) {
$value = $this->NullValue;
}
if (EW_IS_PHP5) {
$value = ew_ConvertToUtf8($value);
// Convert to UTF-8
$xmlfld = $this->XmlDoc->createElement($name);
$this->XmlRow->appendChild($xmlfld);
$xmlfld->appendChild($this->XmlDoc->createTextNode($value));
} else {
$value = ew_Convert(EW_ENCODING, EW_XML_ENCODING, $value);
// Convert to output encoding
$this->XML .= "<{$name}>" . htmlspecialchars($value) . "</{$name}>";
}
}
示例4: ew_CopyFile
function ew_CopyFile($folder, $fn, $file)
{
$fn = ew_Convert(EW_ENCODING, EW_FILE_SYSTEM_ENCODING, $fn);
if (file_exists($file)) {
if (ew_CreateFolder($folder)) {
$newfile = ew_UploadPathEx(TRUE, $folder) . $fn;
return copy($file, $newfile);
}
}
return FALSE;
}
示例5: ew_ConvertFromUtf8
function ew_ConvertFromUtf8($str)
{
return ew_Convert("UTF-8", EW_ENCODING, $str);
}