本文整理汇总了PHP中utf8::to_iso8859方法的典型用法代码示例。如果您正苦于以下问题:PHP utf8::to_iso8859方法的具体用法?PHP utf8::to_iso8859怎么用?PHP utf8::to_iso8859使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utf8
的用法示例。
在下文中一共展示了utf8::to_iso8859方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Header
/**
* page header
* @see included/fpdf.php
*/
function Header()
{
global $context;
//Select Arial bold 15
$this->SetTextColor(0, 0, 0);
$this->SetFont('Times', '', 10);
$this->Cell(0, 10, utf8::to_iso8859($context['page_title']), 0, 0, 'C');
$this->Ln(4);
// $this->Cell(0,10,$this->articleurl,0,0,'C');
$this->Ln(7);
$this->Line($this->GetX(), $this->GetY(), $this->GetX() + 187, $this->GetY());
//Line break
$this->Ln(12);
$this->SetFont('Times', '', 12);
}
示例2: die
if (Surfer::is_crawler()) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
die(i18n::s('You are not allowed to perform this operation.'));
}
// page title
if (isset($item['title'])) {
$context['page_title'] = $item['title'];
}
// not found
if (!$item['id']) {
include '../error.php';
// access denied
} elseif (!Sections::allow_access($item, $anchor)) {
// give anonymous surfers a chance for HTTP authentication
if (!Surfer::is_logged()) {
Safe::header('WWW-Authenticate: Basic realm="' . utf8::to_iso8859($context['site_name']) . '"');
Safe::header('Status: 401 Unauthorized', TRUE, 401);
}
// permission denied to authenticated user
Safe::header('Status: 401 Unauthorized', TRUE, 401);
Logger::error(i18n::s('You are not allowed to perform this operation.'));
// describe the section
} else {
// compute the url for this section
$url = Sections::get_permalink($item);
// get a description
if ($item['introduction']) {
$description = Codes::beautify($item['introduction']);
} else {
$description = Skin::strip(Codes::beautify($item['description']), 50);
}
示例3: array
Safe::header("icy-notice2: provided by a YACS server<BR>");
Safe::header("icy-pub: 1");
// name
$name = array();
if ($value = implode(' & ', @$data['comments_html']['artist'])) {
$name[] = $value;
}
if ($value = implode(', ', @$data['comments_html']['title'])) {
$name[] = $value;
}
if ($name = implode(' - ', $name)) {
Safe::header("icy-name: " . utf8::to_iso8859(utf8::transcode($name)));
}
// genre
if ($value = implode(', ', @$data['comments_html']['genre'])) {
Safe::header("icy-genre: " . utf8::to_iso8859(utf8::transcode($value)));
}
// audio bitrate
if ($value = @$data['audio']['bitrate']) {
Safe::header("icy-br: " . substr($value, 0, -3));
}
// this server
Safe::header("icy-url: " . $context['url_to_home'] . $context['url_to_root']);
}
// serve the right type
Safe::header('Content-Type: ' . Files::get_mime_type($item['file_name']));
// suggest a name for the saved file
$file_name = utf8::to_ascii($item['file_name']);
Safe::header('Content-Disposition: attachment; filename="' . str_replace('"', '', $file_name) . '"');
// we accepted (limited) range requests
Safe::header('Accept-Ranges: bytes');
示例4: build
//.........这里部分代码省略.........
$y_index = $y2_index = $y3_index = 0;
$index = 0;
while ($field = SQL::fetch_field($rows)) {
// time will be used for x labels
if ($index == 0 && $table['with_zoom'] == 'T') {
} elseif ($index == 0 && $table['with_zoom'] == 'Y') {
} elseif (!$y_title) {
$y_title = '"' . ucfirst($field->name) . '"';
$y_index = $index;
} elseif (!$y2_title) {
$y2_title = '"' . ucfirst($field->name) . '"';
$y2_index = $index;
} elseif (!$y3_title) {
$y3_title = '"' . ucfirst($field->name) . '"';
$y3_index = $index;
break;
}
$index++;
}
// process every table row
$x_labels = array();
$y_values = array();
$y2_values = array();
$y3_values = array();
$y_min = $y_max = NULL;
$count = 1;
while ($row = SQL::fetch($rows)) {
// one cell at a time
$index = 0;
foreach ($row as $name => $value) {
// clean spaces
$label = trim(preg_replace('/\\s/', ' ', $value));
// encode in iso8859
$label = utf8::to_iso8859($label);
// escape quotes to preserve them in the data
$label = str_replace('"', '""', $label);
// quote data
if (preg_match('/-*[^0-9\\,\\.]/', $label)) {
$label = '"' . $label . '"';
}
// x labels
if ($index == 0) {
if ($table['with_zoom'] == 'T') {
array_unshift($x_labels, $label);
} else {
$x_labels[] = $count++;
}
// y value
} elseif ($index == $y_index) {
if ($table['with_zoom'] == 'T') {
array_unshift($y_values, $label);
} else {
$y_values[] = $label;
}
if (!isset($y_min) || intval($label) < $y_min) {
$y_min = intval($label);
}
if (!isset($y_max) || intval($label) > $y_max) {
$y_max = intval($label);
}
// y2 value
} elseif ($index == $y2_index) {
if ($table['with_zoom'] == 'T') {
array_unshift($y2_values, $label);
} else {
$y_values[] = $label;
示例5: define
//
$text = '<html><body>' . "\n";
// display the title
if (isset($context['page_title']) && $context['page_title']) {
$text .= Skin::build_block($context['page_title'], 'page_title');
}
// display error messages, if any
$text .= Skin::build_error_block();
// render and display the content, if any
$text .= $context['text'] . "\n";
$text .= '</body></html>' . "\n";
//
// make some PDF
//
// PDF is not UTF-8
$text = utf8::to_iso8859($text);
// actual generation
if (!defined('FPDF_FONTPATH')) {
define('FPDF_FONTPATH', $context['path_to_root'] . 'included/font/');
}
include_once '../included/fpdf.php';
include_once '../shared/pdf.php';
$pdf = new PDF();
$text = $pdf->encode($text);
//
// transfer to the user agent
//
// blind transfer
if (!headers_sent()) {
Safe::header('Content-Type: application/pdf');
Safe::header('Content-Transfer-Encoding: binary');