本文整理汇总了PHP中getArray函数的典型用法代码示例。如果您正苦于以下问题:PHP getArray函数的具体用法?PHP getArray怎么用?PHP getArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getArray函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: getArray
/**
* @name getArray
* @desc Converts a domElement into an array
* @param domelement $node
* @return array OR false
*/
function getArray($node)
{
$array = false;
if ($node->hasAttributes()) {
foreach ($node->attributes as $attr) {
$array[$attr->nodeName] = $attr->nodeValue;
}
}
if ($node->hasChildNodes()) {
if ($node->childNodes->length == 1) {
$array[$node->firstChild->nodeName] = $node->firstChild->nodeValue;
} else {
foreach ($node->childNodes as $childNode) {
if ($childNode->nodeType != XML_TEXT_NODE) {
$array[$childNode->nodeName][] = getArray($childNode);
}
}
}
}
return $array;
}
开发者ID:sophia2152,项目名称:docx,代码行数:27,代码来源:functions.php
示例17: __construct
function __construct($ad)
{
if (isset($ad['id'])) {
$this->id = $ad['id'];
}
$this->private = $ad['private'];
$this->seller_name = $ad['seller_name'];
$this->email = $ad['email'];
if (isset($ad['allow_mail'])) {
$this->allow_mail = $ad['allow_mail'];
}
$this->phone = $ad['phone'];
$this->city_id = $ad['city_id'];
$this->category_id = $ad['category_id'];
$this->title = $ad['title'];
$this->description = $ad['description'];
$this->price = $ad['price'];
if (isset($ad['id_r'])) {
$this->id_r = $ad['id_r'];
}
return getArray();
}
开发者ID:LEXXiY,项目名称:devschool,代码行数:22,代码来源:oop.php
示例18: loadPlayers
public function loadPlayers()
{
$seasonNumber = substr($this->season, 2, 2);
$playerList = getArray("SELECT name, fullName, birthdate, nationality, positions.position, kitNumber, prefFoot,\n contractExp, transferFee, transferClub, imgSrc, kitNumber, onLoan, loanedOut, squad\n FROM players\n INNER JOIN positions ON positions.positionID = players.position\n WHERE lastSeason >= '{$seasonNumber}' AND firstSeason <= '{$seasonNumber}' AND squad = '{$this->squadName}'\n ORDER BY loanedOut, positionID, kitNumber");
foreach ($playerList as &$playerInfo) {
$name = $playerInfo["name"];
$fullName = $playerInfo["fullName"];
$birthdate = $playerInfo["birthdate"];
$nationality = $playerInfo["nationality"];
$position = $playerInfo["position"];
$kitNumber = $playerInfo["kitNumber"];
$prefFoot = $playerInfo["prefFoot"];
$contractExp = $playerInfo["contractExp"];
$transferFee = $playerInfo["transferFee"];
$transferClub = $playerInfo["transferClub"];
$loanedOut = $playerInfo["loanedOut"];
$imgURL = $playerInfo["imgSrc"];
$squad = $playerInfo["squad"];
$player = new Player($name, $fullName, $birthdate, $nationality, $position, $kitNumber, $prefFoot, $contractExp, $transferFee, $transferClub, $imgURL, $loanedOut, $squad);
array_push($this->squad, $player);
}
}
开发者ID:roarher,项目名称:real-madrid-web,代码行数:22,代码来源:Squad.php
示例19: getUserInfo
/**
* Gets user's information from database by user's id
* @param $sId - user ID
* @return $aInfo - user info
*/
function getUserInfo($sId)
{
global $sWomanImageUrl;
global $sManImageUrl;
global $sImagesPath;
global $sProfileUrl;
global $sRootURL;
//get info by ID on these fields
$sNick = "";
$sSex = "";
$sAge = "0";
$sDesc = "";
$sImg = "";
$sProfile = "";
// You should change this query to retrieve user's data correctly
$aUser = getArray("SELECT * FROM `Profiles` WHERE `ID` = '" . $sId . "' LIMIT 1");
/**
* Define photo.
* If this user has a photo you should define it's uri here.
* Otherwise a "no_photo" image is used.
*/
if ((int) $aUser['PrimPhoto'] != 0) {
$sPhoto = $sImagesPath . $aUser['ID'] . "/thumb_" . getValue("SELECT `med_file` FROM `media` WHERE `med_id`='" . $aUser['PrimPhoto'] . "'");
} else {
$sPhoto = $aUser['Sex'] == 'female' ? $sWomanImageUrl : $sManImageUrl;
}
$sSex = isset($aUser['Sex']) ? $aUser['Sex'] : "male";
$sNick = $aUser['NickName'];
$sAge = isset($aUser['DateOfBirth']) ? getAge($aUser['DateOfBirth']) : "25";
$sDesc = isset($aUser['DescriptionMe']) ? $aUser['DescriptionMe'] : "";
$sModRewrite = getValue("SELECT `VALUE` FROM `GlParams` WHERE `Name`='enable_modrewrite' LIMIT 1");
$sProfile = $sModRewrite == "on" ? $sRootURL . $sNick : $sProfileUrl . "?ID=" . $sId;
/**
* Return user info.
* NOTE. Do not change the return statement order.
*/
return array("nick" => $sNick, "sex" => $sSex, "age" => $sAge, "desc" => $sDesc, "photo" => $sPhoto, "profile" => $sProfile);
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:43,代码来源:customFunctions.inc.php
示例20: getUserInfo
/**
* Gets user's information from database by user's id
* @param $sId - user ID
* @return $aInfo - user info
*/
function getUserInfo($sId, $bNick = false)
{
global $sWomanImageUrl;
global $sManImageUrl;
global $sProfileUrl;
global $sRootURL;
//get info by ID on these fields
$sNick = "";
$sSex = "";
$sAge = "0";
$sDesc = "";
$sPhoto = "";
$sProfile = "";
//You should change this query to retrieve user's data correctly
$sWherePart = ($bNick ? "`NickName`" : "`ID`") . " = '" . $sId . "'";
$aUser = getArray("SELECT * FROM `Profiles` WHERE " . $sWherePart . " LIMIT 1");
/**
* Define photo.
* If this user has a photo you should define it's uri here.
* Otherwise a "no_photo" image is used.
*/
$oBaseFunctions = bx_instance("BxBaseFunctions");
$sSex = !empty($aUser['Sex']) ? $aUser['Sex'] : "male";
$sPhoto = $oBaseFunctions->getMemberAvatar($sId);
if (empty($sPhoto)) {
$sPhoto = $sSex == "male" ? $sManImageUrl : $sWomanImageUrl;
}
$sNick = $aUser['NickName'];
$sAge = isset($aUser['DateOfBirth']) ? getAge($aUser['DateOfBirth']) : "25";
$sDesc = isset($aUser['DescriptionMe']) ? strip_tags($aUser['DescriptionMe']) : "";
$sProfile = getParam('enable_modrewrite') == "on" ? $sRootURL . $sNick : $sProfileUrl . "?ID=" . $sId;
/**
* Return user info.
* NOTE. Do not change the return statement order.
*/
return array("id" => (int) $aUser["ID"], "nick" => $sNick, "sex" => $sSex, "age" => $sAge, "desc" => $sDesc, "photo" => $sPhoto, "profile" => $sProfile);
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:42,代码来源:customFunctions.inc.php
注:本文中的getArray函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论