• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getLastPathSegment函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getLastPathSegment函数的典型用法代码示例。如果您正苦于以下问题:PHP getLastPathSegment函数的具体用法?PHP getLastPathSegment怎么用?PHP getLastPathSegment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getLastPathSegment函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getLastPathSegment

<?php

$slug = getLastPathSegment(get_permalink());
$cat = ucfirst($slug);
?>

<?php 
date_default_timezone_set('America/New_York');
$dayToday = date("w");
function phone_format($phone)
{
    if (!empty($phone)) {
        $phone = preg_replace('/[^0-9]*/', '', $phone);
        $areaCode = substr($phone, 0, 3);
        $exchange = substr($phone, 3, 3);
        $extension = substr($phone, -4);
        $phone = '(' . $areaCode . ') ' . $exchange . '-' . $extension;
    }
    return $phone;
}
?>

<?php 
$theDateIs = date("m-d-Y");
/* Temporary until can dates into database */
$breakDates = array("10-28-2013", "11-11-2013", "11-28-2013", "11-29-2013");
$breakMessage = "Hours may vary during the semester break, it is recommended that you call ahead.";
$specialDates = array("11-21-2013");
$specialDatesMessage = "Campus closes at 3 p.m. today for UCF v. Rutgers (Football)";
?>
开发者ID:briancompton,项目名称:knightsplaza,代码行数:30,代码来源:locations.php


示例2: getLastPathSegment

		</header>
		<!-- Ads -->
		<div class="row">
			<div class="large-8 small-12 columns">
				<!-- /6880916/Top-Radio-Top-728-300 -->
				<div id='ad-top'>
				<script type='text/javascript'>
				googletag.cmd.push(function() { googletag.display('ad-top'); });
				</script>
				</div>
			</div>
		</div>
		<br />
		<!-- breadcrumbs -->
		<?php 
$data = getLastPathSegment($_SERVER['REQUEST_URI']);
$crumbString1 = "/" . $data[0] . "/";
if (isset($data[1])) {
    $crumbString2 = "/" . $data[0] . "/" . $data[1] . "/";
}
if ($data[0]) {
    echo '<div class="row">';
    echo '<div class="small-12 columns">';
    echo '<ul class="breadcrumbs">';
    if (isset($data[1])) {
        echo '<li><a href="/">Home</a></li>';
        echo "<li><a href={$crumbString1}>{$data['0']}</a></li>";
        echo "<li class='current'><a href={$crumbString2}>{$data['1']}</a></li>";
    } else {
        echo '<li><a href="/">Home</a></li>';
        echo "<li class='current'><a href={$crumbString1}>{$data['0']}</a></li>";
开发者ID:shadowin1126,项目名称:TopRadioTheme,代码行数:31,代码来源:category-electronic-dance.php


示例3: date_default_timezone_set

 *
 * @package kp
 */
date_default_timezone_set('America/New_York');
$dayToday = date("w");
function getLastPathSegment($url)
{
    $path = parse_url($url, PHP_URL_PATH);
    $pathTrimmed = trim($path, '/');
    $pathTokens = explode('/', $pathTrimmed);
    if (substr($path, -1) !== '/') {
        array_pop($pathTokens);
    }
    return end($pathTokens);
}
$pageClass = getLastPathSegment(get_permalink());
?>



<!DOCTYPE html>
<html <?php 
language_attributes();
?>
>
<head>
<meta charset="<?php 
bloginfo('charset');
?>
">
<meta name="viewport" content="width=device-width, initial-scale=1">
开发者ID:briancompton,项目名称:knightsplaza,代码行数:31,代码来源:header.php


示例4: array

                <a href="" class="active">Todas</a>
            </li>
            <?php 
$args_cat = array('orderby' => 'id', 'style' => 'list', 'title_li' => '');
wp_list_categories($args_cat);
?>
        </ul>
    </div>
</nav>

<section id="index">
    
    <div class="container">
		<div id="artigos">
            <?php 
$args = array('posts_per_page' => 6, 'post_type' => 'post', 'category_name' => getLastPathSegment($_SERVER['REQUEST_URI']));
query_posts($args);
global $count;
$count = 0;
$totalposts = $wp_query->found_posts;
?>
			<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
            
				<div class="artigo <?php 
        if ($count % 3 == 0) {
            echo "first";
        }
开发者ID:JonathanCosta,项目名称:Vou-de-Marisa,代码行数:31,代码来源:archive.php


示例5: array

        <ico class="arrow next sprite-next">></ico> 
        <div class="bullets"></div>
    <!--/div-->
</section>
<?php } //endif; ?>

<?php
$args = array(
    'posts_per_page' => 10,
    'name' => getLastPathSegment($_SERVER['REQUEST_URI'])
);

$pos = strrpos($_SERVER['REQUEST_URI'], "/tags/");
if ($pos > -1) {
    $args['name'] = null;
    $args['tag'] = getLastPathSegment($_SERVER['REQUEST_URI']);
} else {
    $args['tag'] = null;
}

$resultssingle = new WP_Query( $args );
?>

<section id="single">
    <div class="container">
        <div id="artigos">
            <?php if ( $resultssingle->have_posts() ) : while ( $resultssingle->have_posts() ) : $resultssingle->the_post(); ?>
                <div class="content_post">
                    <span class="date">
                        <span><?php the_time('d') ?></span>
                        <b class="sprite-monthyear"><?php the_time('F') ?><br><?php the_time('Y') ?></b>
开发者ID:JonathanCosta,项目名称:Vou-de-Marisa,代码行数:31,代码来源:single.php


示例6: get_template_directory_uri

<script src="<?php 
echo get_template_directory_uri();
?>
/js/image-marker.js"></script>
<script src="<?php 
echo get_template_directory_uri();
?>
/js/TweenMax.min.js"></script>
<script src="<?php 
echo get_template_directory_uri();
?>
/js/general.js?117"></script>

<?php 
$isLoggedIn = FrontUser::isLoggedIn();
if (!$isLoggedIn && strpos(getLastPathSegment($_SERVER['REQUEST_URI']), "cadastre-se") === false && strpos(getLastPathSegment($_SERVER['REQUEST_URI']), "login") === false && $_COOKIE['firsttime'] == "yes") {
    ?>
            <div class="film"></div>
            <div class="formnewuser">
                <p class="title"> Fa&ccedil;a seu cadastro <a href="#" class="closelightbox">X</a></p>
                <div class="left">
                    <?php 
    if (isset($theme_opts[marisa_call_sign_fd]) && strlen($theme_opts[marisa_call_sign_fd]) > 0) {
        echo "<img src='" . $theme_opts[marisa_call_sign_fd] . "' title='' />";
    }
    ?>
                </div>
                <div class="right">
                    <div class="text">
                        <h4>
                            faça seu cadastro agora e ganhe desconto em produtos exclusivos
开发者ID:JonathanCosta,项目名称:Vou-de-Marisa,代码行数:31,代码来源:footer.php


示例7: define

<?php

define("page", "page");
get_header();
?>

<section id="page">
	<div class="container">
		<div id="artigos">
            <?php 
$argspage = array('post_type' => 'page', 'pagename' => getLastPathSegment($_SERVER['REQUEST_URI']));
//query_posts($args);
$resultspage = new WP_Query($argspage);
?>
            <?php 
if ($resultspage->have_posts()) {
    while ($resultspage->have_posts()) {
        $resultspage->the_post();
        ?>
                <div class="pagecontent">
                    <h1><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h1>
                    <p><?php 
        the_content();
        ?>
</p>
开发者ID:JonathanCosta,项目名称:Vou-de-Marisa,代码行数:31,代码来源:page.php



注:本文中的getLastPathSegment函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getLeonardoLink函数代码示例发布时间:2022-05-15
下一篇:
PHP getLastInsertId函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap