本文整理汇总了PHP中getMetaTags函数的典型用法代码示例。如果您正苦于以下问题:PHP getMetaTags函数的具体用法?PHP getMetaTags怎么用?PHP getMetaTags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getMetaTags函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDescription
function getDescription($url, $type = null)
{
$metaTags = getMetaTags($url);
$desc = null;
$ogdesc = null;
for ($i = 0; $i < $metaTags->length; $i++) {
$metaTag = $metaTags->item($i);
if (strtolower($metaTag->getAttribute('name')) == 'description') {
$desc = $metaTag->getAttribute('content');
}
if (strtolower($metaTag->getAttribute('property')) == 'og:description') {
$ogdesc = $metaTag->getAttribute('content');
}
}
if ($type = 'og') {
if ($ogdesc) {
return $ogdesc;
} else {
return 'no description found';
}
} else {
if ($desc) {
return $desc;
} else {
if ($ogdesc) {
return $ogdesc;
} else {
return 'no description found';
}
}
}
}
示例2: getHTMLTagContent
?>
<html <?php
echo getHTMLTagContent();
?>
>
<head>
<script type="text/javascript" charset="UTF-8" src="<?php
echo getScriptJS(__FILE__);
?>
"></script>
<?php
include "application_" . $_SESSION['language'] . ".php";
include "mailfunctions_" . $_SESSION['language'] . ".php";
?>
<?php
echo getMetaTags();
?>
<title><?php
echo $_SESSION['Application_title'];
?>
<convert>#label=243<convert></title>
<link rel="stylesheet" type="text/css" href="../css/details.css" />
<link rel="stylesheet" type="text/css" href="../css/global.css" />
<link rel="stylesheet" type="text/css" href="../css/global_p.css" media="print" />
<?php
}
if ($part == "js" || !$parted) {
?>
<script type="text/javascript" src="../scripts/lib/proj4js-combined.CRO.1.0.0.js"></script>
<!--script type="text/javascript" src="../scripts/converter.class.js"></script-->
<script type="text/javascript" src="../scripts/jquery-1.4.2.min.js"></script>
示例3: getMetaTags
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
print getMetaTags();
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php
print getTitle();
?>
» Editing <?php
print getPage();
?>
</title>
<link rel="stylesheet" type="text/css" href="<?php
print getCSSURL();
?>
" />
</head>
<body>
<div id="navigation">
<p><a href="<?php
print getHomeURL();
?>
">Home</a>
| <a href="<?php
print getGlobalHistoryURL();
?>
">History</a>
<?php
if (getUser() != "") {
?>
示例4: sendMail
function sendMail($mail_dest, $subject, $mail_body, $from_email = "", $add_cc_email = "", $send_a_copy = true)
{
$mail_subject = "[" . $_SESSION['Application_name'] . "]" . " " . $subject;
if ($from_email == "") {
$from_email = $_SESSION['Application_mail'];
}
$reply_email = $from_email;
$header_date = date("D, j M Y H:i:s");
//-0600"); // avec offset horaire
//HTML Content
$css = 'body
{
font-family: arial, sans-serif;
font-size: 9pt;
background-color: white;
color: black;
}
a
{
text-decoration: none;
color: #34558A;
border-bottom: dotted 1px #458EFF;
}
a:hover
{
color: #FFA713;
border-bottom: dotted 1px #FFA713;
}';
$html_text_body = getDoctype(false) . '<html ' . getHTMLTagContent() . '><head>' . getMetaTags() . '<style type="text/css">' . $css . '</style><title>' . $subject . '</title></head><body>' . $mail_body . '</body></html>';
//TXT Content
$plain_text_body = HTML2TxtMail($mail_body);
$mime_boundary = md5(uniqid(mt_rand()));
$mime_boundary_header = chr(34) . $mime_boundary . chr(34);
$mail_header = 'From: ' . $from_email . "\n";
if ($add_cc_email != "") {
$mail_header .= 'Cc: ' . $add_cc_email . "\n";
}
if ($send_a_copy) {
$mail_header .= 'Bcc: ' . $_SESSION['Application_mail'] . "\n";
}
$mail_header .= 'Reply-To: ' . $reply_email . "\n";
$mail_header .= 'Return-Path: ' . $reply_email . "\n";
$mail_header .= 'MIME-Version: 1.0' . "\n";
$mail_header .= 'Content-Type: multipart/alternative;' . "\n";
$mail_header .= ' boundary=' . $mime_boundary . "\n";
$mail_header .= 'X-Mailer: PHP/' . phpversion() . "\n";
$mail_header .= 'Date: ' . $header_date . "\n";
//-----------------------------------------------
// TXT
//-----------------------------------------------
$mail_body = 'This is a multi-part message in MIME format.' . "\n\n";
$mail_body .= '--' . $mime_boundary . "\n";
$mail_body .= 'Content-Type: text/plain; charset=UTF-8' . "\n";
$mail_body .= 'Content-Transfer-Encoding: 8bit' . "\n\n";
$mail_body .= $plain_text_body . "\n\n";
//-----------------------------------------------
// HTML
//-----------------------------------------------
$mail_body .= '--' . $mime_boundary . "\n";
$mail_body .= 'Content-Type: text/html; charset=UTF-8' . "\n";
$mail_body .= 'Content-Transfer-Encoding: 8bit' . "\n\n";
$mail_body .= $html_text_body . "\n\n";
$mail_body .= '--' . $mime_boundary . '--' . "\n";
return mail($mail_dest, $mail_subject, $mail_body, $mail_header);
}