本文整理汇总了PHP中load::m方法的典型用法代码示例。如果您正苦于以下问题:PHP load::m方法的具体用法?PHP load::m怎么用?PHP load::m使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类load
的用法示例。
在下文中一共展示了load::m方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse_url
// a directory slash ("/"). The script below assumes it.
$imagedir = CUSTOMER_IMAGE_DIR . $GID . '/';
// What are the websites (hostnames) that can use this
// image?
// If your site can be accessed with or without the
// "www" prefix, make sure you put both here. Do not put
// any trailing slashes ("/") nor any "http://" prefixes.
// Follow the example below.
$url_meta = parse_url(load::m('setting_m')->get('SITE_URL'));
$url_meta_no_www = str_replace("www.", "", $url_meta['host']);
$validprefixes = array($url_meta['host'], $url_meta_no_www);
// What is the main page of your website? Visitors will
// be directed here if they type
// "http://www.example.com/chimage.php"
// in their browser.
$homepage = load::m('setting_m')->get('APP_FANPAGE');
function isreferrerokay($referrer, $validprefixes)
{
$validreferrer = 0;
$authreferrer = current($validprefixes);
while ($authreferrer) {
if (eregi("^https?://{$authreferrer}/", $referrer)) {
$validreferrer = 1;
break;
}
$authreferrer = next($validprefixes);
}
return $validreferrer;
}
//----------------------- main program -----------------------
$image = $src;
示例2: parse_url
<?php
echo "<pre>";
/*
$url_meta = parse_url("http://www.youtube.com/watch?v=B37wW9CGWyY");
$url_meta['host'] = str_replace("www.","",$url_meta['host']);
print_r($url_meta);
parse_str($url_meta['query'],$o);
print_r($o);
*/
/*
$ok = load::l('facebook')->api("/1048572455137/picture");
print_r($ok);
*/
echo load::m('media_m')->showMedia(2, false);