本文整理汇总了PHP中isN函数的典型用法代码示例。如果您正苦于以下问题:PHP isN函数的具体用法?PHP isN怎么用?PHP isN使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseMovie
static function parseMovie($id, $p_code)
{
$url = replaceStr(SinaTeachParse::BASE_SHOW_EPISODE, '{COURSE_ID}', $id);
$content = getPage($url, $p_code);
$content = json_decode($content);
if (is_object($content) && property_exists($content, 'result') && property_exists($content->result, 'data') && property_exists($content->result->data, 'lessoninfo')) {
$contents = $content->result->data->lessoninfo;
if (is_array($contents) && count($contents) > 0) {
$sites = array();
$site = array();
$site['site_url'] = "sina";
$site['site_name'] = "sinahd";
$site['max_episode'] = 'true';
$episodes = array();
foreach ($contents as $content) {
$episodes[] = array('name' => property_exists($content, 'name') ? $content->name : "1", 'guest' => property_exists($content, 'short_name') ? $content->short_name : "1", 'episode' => property_exists($content, 'jieci') ? $content->jieci : "1", 'url' => property_exists($content, 'burl') ? $content->burl : "", 'img_url' => property_exists($content, 'thumb') ? $content->thumb : "", 'time' => property_exists($content, 'length') ? $content->length : "", 'stream_url' => property_exists($content, 'stream_url') && !isN($content->stream_url) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->stream_url : "", 'androidUrl' => property_exists($content, 'android_url') && !isN($content->android_url) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->android_url : "", 'videoAddressUrl' => property_exists($content, 'ipad_url') && !isN($content->ipad_url) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->ipad_url : "");
}
$site['episodes'] = $episodes;
$sites[] = $site;
// var_dump($episodes);
return $sites;
}
}
return false;
}
示例2: parseMovie
static function parseMovie($id, $p_code, $info)
{
$url = replaceStr(NeteaseTeachParse::BASE_SHOW_EPISODE, '{COURSE_ID}', $id);
$content = getPage($url, $p_code);
$content = json_decode($content);
if (is_object($content)) {
$info->actor = property_exists($content, 'director') ? $content->director : "";
$info->brief = property_exists($content, 'description') ? $content->description : "";
$contents = property_exists($content, 'videoList') ? $content->videoList : array();
if (is_array($contents) && count($contents) > 0) {
$sites = array();
$site = array();
$site['site_url'] = "126";
$site['site_name'] = "126";
$site['max_episode'] = 'true';
$episodes = array();
foreach ($contents as $content) {
$episodes[] = array('name' => property_exists($content, 'title') ? $content->title : "", 'guest' => property_exists($content, 'subtitle') ? $content->subtitle : "", 'episode' => property_exists($content, 'pnumber') ? $content->pnumber : "", 'url' => property_exists($content, 'weburl') ? $content->weburl : "", 'img_url' => property_exists($content, 'imgpath') ? $content->imgpath : "", 'androidUrl' => property_exists($content, 'repovideourl') && !isN($content->repovideourl) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->repovideourl : "", 'videoAddressUrl' => property_exists($content, 'repoMP3url') && !isN($content->repoMP3url) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->repoMP3url : "");
}
$site['episodes'] = $episodes;
$sites[] = $site;
// var_dump($episodes);
return $sites;
}
}
return false;
}
示例3: parseMovieInfoByContent
static function parseMovieInfoByContent($content, $p_code, $type)
{
$content = getBody($content, TVSouLiveParse::contentparmStart, TVSouLiveParse::contentparaend);
// var_dump($content);color='#CC9966'
$content = replaceStr($content, '#CC9966', '#6699CC');
$times = getArray($content, "<font color='#6699CC'>", "</font>");
$names = getArray($content, "<div id='e2' >", "</div>");
// var_dump($names);
// $names=filterScript($names,8191);
$timesArray = explode("{Array}", $times);
$namesArray = explode("{Array}", $names);
// var_dump($timesArray);
$prod_itmes = array();
$index = 0;
foreach ($timesArray as $timeItem) {
$name = $namesArray[$index];
$nameArray = explode('<ahref=', $name);
if (!isN($nameArray[0])) {
$itemName = $nameArray[0];
} else {
$itemName = filterScript($name, 8191);
}
$prod_itmes[$timeItem] = $itemName;
$index++;
}
// var_dump($prod_itmes);
if (count($prod_itmes) == 1) {
return false;
}
return $prod_itmes;
}
示例4: getProgject
function getProgject($p_id)
{
global $db;
$sql = "select * from {pre}cj_vod_projects where p_id=" . $p_id;
$row = $db->getRow($sql);
$proejct = new ProjectVO();
$proejct->p_playlinktype = $row["p_playlinktype"];
$proejct->p_videocodeApiUrl = $row["p_videocodeApiUrl"];
$proejct->p_videocodeApiUrlParamstart = $row["p_videocodeApiUrlParamstart"];
$proejct->p_videocodeApiUrlParamend = $row["p_videocodeApiUrlParamend"];
$proejct->p_videourlstart = $row["p_videourlstart"];
$proejct->p_videourlend = $row["p_videourlend"];
$proejct->p_videocodeType = $row["p_videocodeType"];
//api start
$proejct->playcodeApiUrl = $row["p_playcodeApiUrl"];
$proejct->playcodeApiUrltype = $row["p_playcodeApiUrltype"];
$proejct->p_playcodeApiUrlParamend = $row["p_playcodeApiUrlParamend"];
$proejct->playcodeApiUrlParamstart = $row["p_playcodeApiUrlParamstart"];
if (isN($proejct->playcodeApiUrltype)) {
$proejct->playcodeApiUrltype = 0;
}
if (isN($proejct->p_videocodeType)) {
$proejct->p_videocodeType = 0;
}
$proejct->p_coding = $row["p_coding"];
$proejct->p_classtype = $row["p_classtype"];
$proejct->p_typestart = $row["p_typestart"];
$proejct->p_typeend = $row["p_typeend"];
$proejct->p_collect_type = $row["p_collect_type"];
$proejct->p_script = $row["p_script"];
$proejct->p_playtype = $row["p_playtype"];
unset($row);
return $proejct;
}
示例5: parseVodPad
function parseVodPad($rs, $scoreDouban)
{
global $db;
while ($row = $db->fetch_array($rs)) {
$name = $row["d_name"];
$area = $row["d_area"];
$year = $row["d_year"];
$d_id = $row["d_id"];
$type = $row["d_type"];
$doubanid = $row['d_douban_id'];
$flag = true;
if (!isN($doubanid) && $doubanid !== 0 && $doubanid !== '0') {
$flag = false;
$pic = $scoreDouban->getPicById($doubanid, 7 / 5);
} else {
$pic = $scoreDouban->getDouBanPics($name, $year, $area, 7 / 5);
}
if ($pic !== false) {
$doubanid = $pic['id'];
if (!isN($doubanid) && $flag) {
$db->Update("{pre}vod", array("d_douban_id"), array($doubanid), "d_id=" . $d_id);
}
$pic = $pic['pic'];
}
if ($pic !== false && !isN($pic)) {
$padPic = explode("{Array}", $pic);
if (count($padPic) > 0) {
$padPic = $padPic[0];
writetofile("updateVodPic.txt", 'd_pic_ipad{=}' . $padPic . '{=}d_pic_ipad_tmp{=}' . $pic);
$db->Update("{pre}vod", array("d_pic_ipad", "d_pic_ipad_tmp"), array($padPic, $pic), "d_id=" . $d_id);
}
}
}
unset($rs);
}
示例6: replaceTop
function replaceTop($topic_id, $rec_topic_id, $rec_topic_rule)
{
global $db;
// var_dump($rec_topic_id);
$rs = $db->query("SELECT vod_id FROM mac_vod_topic_items,mac_vod WHERE vod_id=d_id AND (can_search_device like '%TV%' or can_search_device is null or can_search_device ='' ) and flag=1 and topic_id =" . $topic_id . " ORDER BY disp_order DESC LIMIT 0 , 10");
$movie = array();
while ($row = $db->fetch_array($rs)) {
$movie[] = $row['vod_id'];
}
foreach (array_keys($rec_topic_rule) as $key) {
$position = $key;
$position = $position - 1;
$displayOrder = $rec_topic_rule[$key];
$movieid = $movie[$position];
$d_addtime = date('Y-m-d H:i:s', time());
// var_dump($movieid);
// var_dump($position);
// var_dump($displayOrder);
$id = $db->getRow('select id from mac_vod_topic_items where flag=1 and topic_id =' . $rec_topic_id . ' and disp_order=' . $displayOrder);
$id = $id['id'];
if (!isN($id)) {
// var_dump($id);
$rs = $db->query("update mac_vod_topic_items set vod_id='" . $movieid . "' WHERE id =" . $id);
} else {
$rs = $db->query("insert into mac_vod_topic_items (topic_id,vod_id,flag,disp_order,create_date) values('" . $rec_topic_id . "','" . $movieid . "',1,'" . $displayOrder . "','" . $d_addtime . "')");
}
}
}
示例7: parseVodPad
function parseVodPad($rs, $scoreDouban)
{
global $db;
while ($row = $db->fetch_array($rs)) {
$name = $row["d_name"];
$area = $row["d_area"];
$year = $row["d_year"];
$d_id = $row["d_id"];
$type = $row["d_type"];
$doubanid = $row['d_douban_id'];
writetofile("updateVodThumb.txt", 'sssdoubanid{=}' . $doubanid);
$flag = true;
if (!isN($doubanid) && $doubanid !== 0 && $doubanid !== '0') {
$flag = false;
writetofile("updateVodThumb.txt", 'getThumb:' . $name);
$pic = $scoreDouban->getThumb($doubanid);
} else {
writetofile("updateVodThumb.txt", 'getDoubanThumb:' . $name);
$pic = $scoreDouban->getDoubanThumb($name, $year, $area);
}
if ($pic !== false) {
$doubanid = $pic['id'];
writetofile("updateVodThumb.txt", 'doubanid{=}' . $doubanid);
if (!isN($doubanid) && $flag) {
$db->Update("{pre}vod", array("d_douban_id"), array($doubanid), "d_id=" . $d_id);
}
$pic = $pic['pic'];
}
if ($pic !== false && !isN($pic)) {
writetofile("updateVodThumb.txt", 'd_pic{=}' . $pic);
$db->Update("{pre}vod", array("d_pic"), array($pic), "d_id=" . $d_id);
}
}
unset($rs);
}
示例8: editall
function editall()
{
global $db;
$l_id = be("arr", "l_id");
$ids = explode(",", $l_id);
foreach ($ids as $id) {
$l_name = be("post", "l_name" . $id);
$l_sort = be("post", "l_sort" . $id);
$l_url = be("post", "l_url" . $id);
if (isN($l_name)) {
echo "名称不能为空";
exit;
}
if (isN($l_url)) {
echo "地址不能为空";
exit;
}
if (isN($l_sort)) {
$l_sort = $db->getOne("SELECT MAX(l_sort) FROM {pre}link");
}
if (!isNum($l_sort)) {
echo "排序号不能为空";
exit;
}
$db->Update("{pre}link", array("l_name", "l_url", "l_sort"), array($l_name, $l_url, $l_sort), "l_id=" . $id);
}
echo "修改完毕";
}
示例9: parseVideoIOSUrls
function parseVideoIOSUrls($sql)
{
global $db;
writetofile("parseVideo.txt", $sql);
$rs = $db->query($sql);
$rscount = $db->num_rows($rs);
if ($rscount == 0) {
errmsg("没有可用的数据");
} else {
while ($row = $db->fetch_array($rs)) {
$u_id = $row["u_id"];
$u_weburl = $row["u_weburl"];
$p_id = $row["p_id"];
$m_urltest = $row["m_urltest"];
if (isN($u_weburl)) {
$u_weburl = $m_urltest;
}
$project = getProgject($p_id);
$webCode = getPage($u_weburl, $project->p_coding);
// $videoUrl = crawleVideoByPlayUrl($webCode,$project);
$videoUrl = ContentProviderFactory::getContentProvider($project->p_playtype)->parseIOSVideoUrlByContent($webCode, $project->p_coding, $project->p_script);
writetofile("android_log.txt", $strlink . '{===}' . $androidUrl);
if (!isN($videoUrl)) {
$sql = "update {pre}cj_vod_url set iso_video_url='" . $videoUrl . "', u_weburl='" . $u_weburl . "',android_vedio_url ='" . $androidUrl . "' where u_id=" . $u_id;
writetofile("parseVideo.txt", $sql);
$db->query($sql);
} else {
writetofile("videoUrlErrors.txt", '{===}' . $p_id . '{===}' . $u_id . '{===}' . $u_weburl);
}
}
}
unset($rs);
}
示例10: editall
function editall()
{
global $db;
$t_id = be("arr", "t_id");
$ids = explode(",", $t_id);
foreach ($ids as $id) {
$t_name = be("post", "t_name" . $id);
$t_sort = be("post", "t_sort" . $id);
$t_enname = be("post", "t_enname" . $id);
$t_template = be("post", "t_template" . $id);
$t_pic = be("post", "t_pic" . $id);
if (isN($t_name)) {
echo "信息填写不完整!";
exit;
}
if (isN($t_enname)) {
echo "信息填写不完整!";
exit;
}
if (isN($t_sort)) {
$t_sort = $db->getOne("SELECT MAX(t_sort) FROM {pre}vod_topic") + 1;
}
if (!isNum($t_sort)) {
echo "信息填写不完整!";
exit;
}
$db->Update("{pre}art_topic", array("t_name", "t_enname", "t_template", "t_sort", "t_pic"), array($t_name, $t_enname, $t_template, $t_sort, $t_pic), "t_id=" . $id);
}
updateCacheFile();
echo "修改完毕";
}
示例11: parseIOSVideoUrlByContent
public function parseIOSVideoUrlByContent($content, $p_coding, $p_script)
{
$videoAddressUrl = "";
$contentObj = json_decode($content);
if (is_object($contentObj) && property_exists($contentObj, 'down_urls') && property_exists($contentObj->down_urls, 'urls')) {
if (is_array($contentObj->down_urls->urls)) {
foreach ($contentObj->down_urls->urls as $item) {
if (!isN($item->url)) {
if (isN($videoAddressUrl)) {
if ($item->type == "hd") {
$videoAddressUrl = 'mp4' . MovieType::VIDEO_NAME_URL_SEP . $item->url;
} else {
$videoAddressUrl = $item->type . MovieType::VIDEO_NAME_URL_SEP . $item->url;
}
} else {
if ($item->type == "hd") {
$videoAddressUrl = $videoAddressUrl . MovieType::VIDEO_SEP_VERSION . 'mp4' . MovieType::VIDEO_NAME_URL_SEP . $item->url;
} else {
$videoAddressUrl = $videoAddressUrl . MovieType::VIDEO_SEP_VERSION . $item->type . MovieType::VIDEO_NAME_URL_SEP . $item->url;
}
}
}
}
}
}
//var_dump($videoAddressUrl);
return $videoAddressUrl;
}
示例12: chkLogin2
function chkLogin2()
{
global $db;
$m_id = getCookie('adminid');
ckSql($m_id);
$m_name = getCookie('adminname');
ckSql($m_name);
$m_check = getCookie('admincheck');
ckSql($m_check);
$index = 'index.php';
if (strpos($_SERVER['PHP_SELF'], 'editor') > -1) {
$index = "../" . $index;
}
if (!isN($m_name) && !isNum($m_id)) {
$row = $db->getRow('SELECT * FROM {pre}manager WHERE m_name=\'' . mysql_real_escape_string($m_name) . '\' AND m_id= \'' . $m_id . '\' AND m_status=1');
if ($row) {
$loginValidate = md5($row['m_random'] . $row['m_name'] . $row['m_id']);
if ($m_check != $loginValidate) {
sCookie('admincheck', '');
redirect($index . '?m=admin-login', 'top.');
}
} else {
sCookie('admincheck', '');
redirect($index . '?m=admin-login', 'top.');
}
} else {
redirect($index . '?m=admin-login', 'top.');
}
}
示例13: import
function import()
{
global $db;
if ($_FILES["file"]["error"] > 0) {
echo "Error: " . $_FILES["file"]["error"] . "<br />";
} else {
$file = $_FILES["file"]["tmp_name"];
$tempFile = $_FILES["file"]["name"];
if (!isN($tempFile) && strpos($tempFile, ".csv") !== false && strpos($tempFile, ".csv") === strlen($tempFile) - 4) {
try {
$str = file_get_contents($file);
$str = replaceStr($str, chr(10), "");
$tvArrays = explode(chr(13), $str);
//setGlobalCache("cache_vodlang",$cachearea,1,'php');
} catch (Exception $e) {
$tvArrays = array();
}
foreach ($tvArrays as $tv) {
$items = explode(",", $tv);
if (is_array($items)) {
$count = count($items);
if ($count > 0) {
$id = $items[0];
} else {
$id = '';
$url = '';
}
if ($count > 1) {
$url = $items[1];
} else {
$url = '';
}
if ($count > 2) {
$definition = $items[2];
} else {
$definition = '';
$playfrom = '';
}
if ($count > 3) {
$playfrom = $items[3];
} else {
$playfrom = '';
}
if (!isN($id) && !isN($url)) {
$row = $db->getRow("select * from mac_tv_play where tv_playurl='" . $url . "' and tv_id=" . $id);
if (!$row) {
$sql = "insert into mac_tv_play(tv_id,tv_playurl,status,tv_definition,tv_playfrom) values('" . $id . "','" . $url . "','1','" . $definition . "','" . $playfrom . "')";
} else {
$sql = "update mac_tv_play set status='1', tv_definition='" . $definition . "',tv_playfrom='" . $playfrom . "' where tv_playurl='" . $url . "' and tv_id=" . $id;
}
$row = $db->query($sql);
}
}
}
echo "修改完毕";
} else {
echo "文件格式不对";
}
}
}
示例14: editall
function editall()
{
global $db;
$t_id = be("arr", "ids");
$ids = explode(",", $t_id);
foreach ($ids as $id) {
$t_flag = be("post", "t_flag" . $id);
$t_sort = be("post", "disp_order" . $id);
if (isN($t_sort)) {
$t_sort = $db->getOne("SELECT MAX(disp_order) FROM {pre}vod_topic_items") + 1;
}
if (!isNum($t_sort)) {
echo "信息填写不完整!";
exit;
}
$db->Update("{pre}vod_topic_items", array("flag", "disp_order"), array($t_flag, $t_sort), "id=" . $id);
}
updateCacheFile();
$topic_id = getBody(getReferer(), 'topic_id=', '&');
if (isN($topic_id)) {
$topic_id = getBodys(getReferer(), 'topic_id=');
}
if (!isN($topic_id)) {
replaceTopRecommend($topic_id);
}
echo "修改完毕";
}
示例15: parseVideoAndroidUrls
function parseVideoAndroidUrls($sql)
{
global $db;
writetofile("parseVideoAndroid.txt", $sql);
// var_dump($sql);
$rs = $db->query($sql);
$rscount = $db->num_rows($rs);
if ($rscount == 0) {
errmsg("没有可用的数据");
} else {
while ($row = $db->fetch_array($rs)) {
$u_id = $row["u_id"];
$u_weburl = $row["u_weburl"];
$p_id = $row["p_id"];
$m_urltest = $row["m_urltest"];
if (isN($u_weburl)) {
$u_weburl = $m_urltest;
}
$project = getProgject($p_id);
$videoUrl = crawleAndroidVideoByPlayUrl($u_weburl, $project);
if (!isN($videoUrl)) {
$sql = "update {pre}cj_vod_url set android_vedio_url='" . $videoUrl . "', u_weburl='" . $u_weburl . "' where u_id=" . $u_id;
writetofile("parseVideoAndroid.txt", $sql);
$db->query($sql);
} else {
writetofile("videoUrlAndroidErrors.txt", '{===}' . $p_id . '{===}' . $u_id . '{===}' . $u_weburl);
}
}
}
unset($rs);
}