当前位置: 首页>>代码示例>>PHP>>正文


PHP getArray函数代码示例

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


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

示例1: loadLeaderboardMinutes

 public function loadLeaderboardMinutes($stat)
 {
     $sql = getArray("\n        SELECT matches.tournamentName, name as player, sum(minutesPlayed) as count\n        FROM player_match\n          INNER JOIN matches ON player_match.date = matches.date\n        WHERE player_match.seasonID = '{$this->season}'\n        GROUP BY name, tournamentName\n        ORDER BY count DESC;");
     self::makeLeaderboardList($sql, $stat);
     $sql = getArray("\n        SELECT name as player, sum(minutesPlayed) as count\n        FROM player_match\n          INNER JOIN matches ON player_match.date = matches.date\n        WHERE player_match.seasonID = '{$this->season}'\n        GROUP BY name\n        ORDER BY count DESC;");
     return self::makeLeaderboardListTotal($sql);
 }
开发者ID:roarher,项目名称:real-madrid-web,代码行数:7,代码来源:LeaderboardContainer.php

示例2: loadNations

 public function loadNations()
 {
     $sql = getArray("\n          SELECT nationality\n          FROM nations;");
     foreach ($sql as &$nation) {
         $this->nations[$nation["nationality"]] = $nation["nationality"];
     }
 }
开发者ID:roarher,项目名称:real-madrid-web,代码行数:7,代码来源:NationContainer.php

示例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;
 }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:31,代码来源:TVSouLiveParse.php

示例4: loadPositions

 private function loadPositions()
 {
     $sql = getArray("\n        SELECT position\n        FROM positions\n        ORDER BY positionID;");
     foreach ($sql as &$position) {
         $this->positions[$position["position"]] = $position["position"];
     }
 }
开发者ID:roarher,项目名称:real-madrid-web,代码行数:7,代码来源:PositionContainer.php

示例5: loadAllMatches

 private function loadAllMatches()
 {
     $matches = getArray("\n        SELECT *\n        FROM matches\n        WHERE matches.seasonID = '{$this->season}'\n        ORDER BY date ASC;");
     $lineUps = getArray("\n        SELECT * FROM lineups");
     if (count($matches) > 0) {
         foreach ($matches as &$match) {
             $newMatch = new Match($match["date"], $match["time"], $match["tournamentName"], $match["location"], $match["opposition"], $match["goalsFor"], $match["goalsAgainst"]);
             if (count($matches) > 0) {
                 foreach ($lineUps as &$lineUp) {
                     if ($lineUp["date"] == $match["date"]) {
                         $newMatch->setLineUp($lineUp);
                     }
                 }
             }
             if ($match["location"] == 'Home') {
                 $this->homeMatches[$match["date"]] = $newMatch;
             } else {
                 if ($match["location"] == 'Away') {
                     $this->awayMatches[$match["date"]] = $newMatch;
                 }
             }
             $this->allMatches[$match["date"]] = $newMatch;
             $this->tournaments[$match["tournamentName"]]->addMatch($newMatch);
         }
     }
 }
开发者ID:roarher,项目名称:real-madrid-web,代码行数:26,代码来源:MatchContainer.php

示例6: loadTournamentStatistics

 function loadTournamentStatistics()
 {
     $tournaments = getArray("SELECT name FROM tournaments;");
     foreach ($tournaments as &$tournament) {
         $this->tournamentStatistics[$tournament["name"]] = new TournamentStatistics($tournament["name"], $this->name, $this->kitNumber);
     }
     $this->events = ["matches" => array(), "goalscorer" => array(), "assist" => array(), "thirdAssist" => array(), "Red" => array(), "Yellow" => array(), "playerOn" => array(), "playerOff" => array()];
 }
开发者ID:roarher,项目名称:real-madrid-web,代码行数:8,代码来源:Player.php

示例7: getOneById

 public function getOneById($id, $split_tag = True)
 {
     $tmp = $this->where(array('id' => $id))->find();
     if ($split_tag == False) {
         return $tmp;
     }
     $tmp['tag'] = getArray($tmp['tag']);
     return $tmp;
 }
开发者ID:greatwhole,项目名称:myspace,代码行数:9,代码来源:ArticleModel.class.php

示例8: loadTournaments

 private function loadTournaments()
 {
     $tournaments = getArray("\n        SELECT *\n        FROM tournaments;");
     if (count($tournaments) > 0) {
         foreach ($tournaments as &$tournament) {
             $tournamentName = $tournament["name"];
             $this->tournaments[$tournamentName] = new Tournament($tournamentName);
         }
     }
 }
开发者ID:roarher,项目名称:real-madrid-web,代码行数:10,代码来源:TournamentContainer.php

示例9: getArray

function getArray($node, $mysql_connection, $userId)
{
    $array = false;
    $startDate = "";
    $endDate = "";
    $value = "";
    if ($node->hasAttributes()) {
        foreach ($node->attributes as $attr) {
            $array[$attr->nodeName] = $attr->nodeValue;
            if ($attr->nodeName == "startDate") {
                $startDate = substr($attr->nodeValue, 0, 10);
                // echo $attr->nodeName .":".$startDate."###</br>";
            } else {
                if ($attr->nodeName == "endDate") {
                    $endDate = substr($attr->nodeValue, 0, 10);
                    // $endDate=$attr->nodeValue;
                    // echo $attr->nodeName .":".$endDate."###</br>";
                } else {
                    if ($attr->nodeName == "value") {
                        $value = substr($attr->nodeValue, 0, 10);
                        // $value=$attr->nodeValue;
                        // echo "startDate:".$startDate."##  #";
                        // echo "endDate:".$endDate."##  #";
                        // echo "value:".$value."##  #";
                        if ($startDate != "" && $endDate != "" && $value != "" && $endDate - $startDate == 1) {
                            $sql = " INSERT INTO sportData (userId,startTime,endTime,step)values (" . $userId . "," . $startDate . "," . $endDate . "," . $value . ")";
                            echo "</br>sql:" . $sql;
                            if (mysql_query($sql)) {
                                echo "***ok***</br>";
                            } else {
                                echo mysql_error();
                            }
                        }
                    }
                }
            }
        }
    }
    if ($node->hasChildNodes()) {
        if ($node->childNodes->length == 1) {
            $array[$node->firstChild->nodeName] = getArray($node->firstChild, $mysql_connection, $userId);
        } else {
            foreach ($node->childNodes as $childNode) {
                if ($childNode->nodeType != XML_TEXT_NODE) {
                    $array[$childNode->nodeName][] = getArray($childNode, $mysql_connection, $userId);
                }
            }
        }
    } else {
        return $node->nodeValue;
    }
    return $array;
}
开发者ID:elva329,项目名称:COMP5321-Project--Enterprise-Web-and-Internet-Computing-for-Managers,代码行数:53,代码来源:fit_data_import.php

示例10: getAuthorOfArticleUsername

function getAuthorOfArticleUsername($articleid)
{
    $select = "SELECT username ";
    $from = " FROM articles, user ";
    $where = " WHERE articles.author_username = user.username AND articleid=" . $articleid . ";";
    $query = $select . $from . $where;
    $userArray = getArray($query);
    if (!$userArray) {
        return -1;
    } else {
        return $userArray[0]['username'];
    }
}
开发者ID:arewold,项目名称:calcuttagutta,代码行数:13,代码来源:userService.php

示例11: daoGetUser

function daoGetUser($username)
{
    if (isset($username)) {
        // something like this? necessary, mysql_dao could possibly do this?
        $username = addSlashes($username);
        $select = "SELECT username, password, email, firstname, lastname, webpage, birthdate, description ";
        $from = "FROM user ";
        $where = "WHERE username = " . $username;
        $query = $select . $from . $where;
        $userinfo = getArray($query);
        return new User($userinfo['username'], $userinfo['password'], $userinfo['email'], $userinfo['firstname'], $userinfo['lastname'], $userinfo['webpage'], $userinfo['birthdate'], $userinfo['description']);
    } else {
        //TODO: Error msg, no user.
    }
}
开发者ID:arewold,项目名称:calcuttagutta,代码行数:15,代码来源:userdao.php

示例12: getList

function getList()
{
    $query = "SELECT s.creator as username, s.name as name, u.firstname as creator, s.styleid as stylesheet, u.firstname FROM stylesheets s, user u WHERE s.creator = u.username;";
    $table = getArray($query);
    foreach ($table as $row) {
        if ($row['stylesheet']) {
            echo "-" . $row['name'] . " (" . $row['creator'] . ")-" . $row['stylesheet'];
        }
        if (userMayRemove($row['stylesheet'])) {
            echo "-1";
        } else {
            echo "-0";
        }
    }
}
开发者ID:arewold,项目名称:calcuttagutta,代码行数:15,代码来源:styleService.php

示例13: loadAllOppositions

 private function loadAllOppositions()
 {
     $oppositions = getArray("\n        SELECT *\n        FROM oppositions WHERE seasonID = '{$this->season}'\n        ORDER BY date ASC;");
     if (count($oppositions) > 0) {
         foreach ($oppositions as &$opposition) {
             $newOpposition = new Opposition($opposition["date"], $opposition["time"], $opposition["tournamentName"], $opposition["location"], $opposition["opposition"]);
             if ($opposition["location"] == 'Home') {
                 $this->homeOppositions[$opposition["date"]] = $newOpposition;
             } else {
                 if ($opposition["location"] == 'Away') {
                     $this->awayOppositions[$opposition["date"]] = $newOpposition;
                 }
             }
             $this->allOppositions[$opposition["date"]] = $newOpposition;
             $this->tournaments[$opposition["tournamentName"]]->addOpposition($newOpposition);
         }
     }
 }
开发者ID:roarher,项目名称:real-madrid-web,代码行数:18,代码来源:OppositionContainer.php

示例14: video_getList

function video_getList($sId)
{
    global $sModule;
    global $aXmlTemplates;
    global $sFilesPath;
    $sMode = getSettingValue($sModule, "listSource");
    $iCount = (int) getSettingValue($sModule, "listCount");
    if (!is_numeric($iCount) || $iCount <= 0) {
        $iCount = 10;
    }
    $oSource = new BxVideosSearch();
    $oSource->aCurrent['sorting'] = 'top';
    $oSource->aCurrent['paginate']['perPage'] = $iCount;
    $oSource->aCurrent['restriction']['id'] = array('value' => $sId, 'field' => 'ID', 'operator' => '<>');
    switch ($sMode) {
        case "Member":
            $sOwner = getValue("SELECT `Owner` FROM `" . MODULE_DB_PREFIX . "Files` WHERE `ID` = '" . $sId . "'");
            $oSource->aCurrent['restriction']['owner'] = array('value' => $sOwner, 'field' => 'Owner', 'operator' => '=');
            break;
        case "Related":
            $aFile = getArray("SELECT * FROM `" . MODULE_DB_PREFIX . "Files` WHERE `ID` = '" . $sId . "'");
            $oSource->aCurrent['restriction']['keyword'] = array('value' => $aFile['Title'] . " " . $aFile['Tags'] . " " . $aFile['Description'], 'field' => '', 'operator' => 'against');
            break;
        case "Top":
        default:
            $oSource->aCurrent['restriction']['id'] = array('value' => $sId, 'field' => 'ID', 'operator' => '<>');
            break;
    }
    $aData = $oSource->getSearchData();
    $iCurrentTime = time();
    $sResult = "";
    for ($i = 0; $i < count($aData); $i++) {
        $aData[$i]['uri'] = $oSource->getCurrentUrl('file', $aData[$i]['id'], $aData[$i]['uri']);
        $aData[$i]['date'] = _format_when($iCurrentTime - $aData[$i]['date']);
        $sImageFile = $aData[$i]['id'] . IMAGE_EXTENSION;
        $sThumbFile = $aData[$i]['id'] . THUMB_FILE_NAME . IMAGE_EXTENSION;
        if (!file_exists($sFilesPath . $sThumbFile)) {
            $sThumbFile = $sImageFile;
        }
        $sResult .= parseXml($aXmlTemplates['file'], $sThumbFile, $aData[$i]['size'], $aData[$i]['ownerName'], $aData[$i]['view'], $aData[$i]['voting_rate'], $aData[$i]['date'], $aData[$i]['title'], BX_DOL_URL_ROOT . $aData[$i]['uri']);
    }
    return $sResult;
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:43,代码来源:customFunctions.inc.php

示例15: parseMovieInfoByContent

 static function parseMovieInfoByContent($content, $p_code, $type)
 {
     $content = getBody($content, CnTVLiveParse::contentparmStart, CnTVLiveParse::contentparaend);
     $items = getArray($content, "<dd>", "</dd>");
     $itemArray = explode("{Array}", $items);
     $prod_itmes = array();
     foreach ($itemArray as $item) {
         $item = filterScript($item, 8191);
         $item = trim($item);
         $item = replaceStr($item, '回看', '');
         $date = substr($item, 0, 5);
         $item = replaceStr($item, $date, '');
         $prod_itmes[$date] = $item;
     }
     if (count($prod_itmes) == 1) {
         return false;
     }
     return $prod_itmes;
 }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:19,代码来源:CnTVLiveParse.php


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