本文整理汇总了PHP中Is_Array函数的典型用法代码示例。如果您正苦于以下问题:PHP Is_Array函数的具体用法?PHP Is_Array怎么用?PHP Is_Array使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Is_Array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addRewriteRules
static function addRewriteRules($rules)
{
if (Is_Array(self::$rewrite_rules) && Is_Array($rules)) {
return Array_Merge(self::$rewrite_rules, $rules);
} else {
return $rules;
}
}
示例2: toXML
/**
* Create XML-string from hash-data
*
*
* @param mixed Hash
* @access public
*/
function toXML($hash, $level=0) {
// converts from hash to xml
$res="";
if (!Is_Array($hash)) {
return $res;
}
foreach($hash as $k=>$v) {
if (substr($k, -5)!="_list") {
// skip NAME_list variables
if ((Is_Array($v)) && IsSet($v[0])) {
// array
if (IsSet($hash[$k."_list"])) {
$v=$hash[$k."_list"];
}
for($i=0;$i<count($v);$i++) {
$res.=str_repeat(" ", $level)."<$k>\n";
$res.=$this->toXML($v[$i], $level+1);
$res.=str_repeat(" ", $level)."</$k>\n";
}
} elseif ((Is_Array($v)) && (!IsSet($v[0]))) {
// hash
$res.=str_repeat(" ", $level)."<$k>\n".$this->toXML($v, $level+1).str_repeat(" ", $level)."</$k>\n";
} else {
// variable
$res.=str_repeat(" ", $level)."<$k>".$v."</$k>\n";
}
}
}
return $res;
}
示例3: TVL_Create
function TVL_Create($TVL)
{
/****************************************************************************/
$__args_types = array('array');
#-----------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/****************************************************************************/
$Result = '';
#-----------------------------------------------------------------------------
foreach (Array_Keys($TVL) as $WordID) {
#---------------------------------------------------------------------------
$Word = $TVL[$WordID];
#---------------------------------------------------------------------------
if (!Is_Array($Word)) {
$Size = StrLen($Word);
} else {
$Word = Bytes_I2B($Size = Next($Word), Prev($Word));
}
#---------------------------------------------------------------------------
$Result .= Bytes_I2B(WORD, HexDec($WordID)) . Bytes_I2B(WORD, $Size) . $Word;
# Значение
}
#-----------------------------------------------------------------------------
return $Result;
}
示例4: Get_Meta
function Get_Meta($key = Null, $default = False, $post_id = Null)
{
# Get the post id
if ($post_id == Null && Is_Object($GLOBALS['post'])) {
$post_id = $GLOBALS['post']->ID;
} elseif ($post_id == Null && !Is_Object($GLOBALS['post'])) {
return False;
}
# Read meta data
$arr_meta = (array) Get_Post_Meta($post_id, '_wp_plugin_fancy_gallery', True);
if (empty($arr_meta) || !Is_Array($arr_meta)) {
$arr_meta = array();
}
# Clean Meta data
foreach ($arr_meta as $k => $v) {
if (!$v) {
unset($arr_meta[$k]);
}
}
# Load default Meta data
$arr_meta = Array_Merge($this->Default_Meta(), $arr_meta);
# Get the key value
if ($key == Null) {
return $arr_meta;
} elseif (isset($arr_meta[$key]) && $arr_meta[$key]) {
return $arr_meta[$key];
} else {
return $default;
}
}
示例5: Related_Terms
static function Related_Terms($attributes = Null)
{
$attributes = Is_Array($attributes) ? $attributes : array();
$attributes = Array_Merge(array('number' => 5), $attributes);
$related_terms = Core::getTagRelatedTerms($attributes);
return Template::load('glossary-related-terms.php', array('attributes' => $attributes, 'related_terms' => $related_terms));
}
示例6: smarty_function_copyright
function smarty_function_copyright($params, $smarty)
{
$Copyright = DB_Select('Config', 'Value', array('UNIQ', 'Where' => "`Param` = 'Copyright'"));
if (!Is_Array($Copyright)) {
return ERROR | @Trigger_Error(500);
}
return $Copyright['Value'];
}
示例7: getOptionsPageUrl
static function getOptionsPageUrl($parameters = array())
{
$url = Add_Query_Arg(array('page' => self::$page_slug), Admin_Url('options-general.php'));
if (Is_Array($parameters) && !empty($parameters)) {
$url = Add_Query_Arg($parameters, $url);
}
return $url;
}
示例8: getParams
public function getParams()
{
$Server = DB_Select('Servers', array('Address', 'Params'), array('UNIQ', 'Where' => SPrintF('(SELECT `ServerID` FROM `OrdersOwners` WHERE `OrdersOwners`.`ID` = %u) = `Servers`.`ID`', $this->params['OrderID'])));
if (!Is_Array($Server)) {
return ERROR | @Trigger_Error(500);
}
$this->params['Server'] = $Server;
return $this->params;
}
示例9: getParams
public function getParams()
{
Debug(print_r($this->params, true));
$Service = DB_Select('Services', array('ID', 'Code', 'Name', 'NameShort'), array('UNIQ', 'ID' => $this->params['ServiceID']));
if (!Is_Array($Service)) {
return ERROR | @Trigger_Error(500);
}
$this->params['Service'] = $Service;
return $this->params;
}
示例10: __UnEscapeTmp
function __UnEscapeTmp(&$item, $key)
{
if (Is_Array($item)) {
Array_Walk($item, '__UnEscapeTmp');
} else {
if (StrPos($item, "%u") !== false) {
$item = $GLOBALS["APPLICATION"]->UnJSEscape($item);
}
}
}
示例11: ValidateLogin
public static function ValidateLogin(&$ErrorMessage, $SelfURL)
{
$Mode = Filter_Input(INPUT_GET, 'openid_mode', FILTER_SANITIZE_SPECIAL_CHARS);
if ($Mode === 'error') {
$ErrorMessage = Filter_Input(INPUT_GET, 'openid_error', FILTER_SANITIZE_STRING);
if (empty($ErrorMessage)) {
$ErrorMessage = 'Something went wrong.';
}
return false;
} else {
if ($Mode !== 'id_res') {
$ErrorMessage = 'Invalid OpenID mode.';
return false;
}
}
// See http://openid.net/specs/openid-authentication-2_0.html#positive_assertions
$Arguments = Filter_Input_Array(INPUT_GET, array('openid_ns' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array('regexp' => '/^http:\\/\\/specs\\.openid\\.net\\/auth\\/2\\.0$/')), 'openid_op_endpoint' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array('regexp' => '/^' . Preg_Quote(self::STEAM_LOGIN, '/') . '$/')), 'openid_claimed_id' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array('regexp' => '/^https?:\\/\\/steamcommunity.com\\/openid\\/id\\/(7656119[0-9]{10})\\/?$/')), 'openid_identity' => FILTER_SANITIZE_URL, 'openid_return_to' => FILTER_SANITIZE_URL, 'openid_response_nonce' => FILTER_SANITIZE_STRING, 'openid_assoc_handle' => FILTER_SANITIZE_SPECIAL_CHARS, 'openid_signed' => FILTER_SANITIZE_SPECIAL_CHARS, 'openid_sig' => FILTER_SANITIZE_SPECIAL_CHARS));
if (!Is_Array($Arguments)) {
$ErrorMessage = 'Invalid arguments.';
return false;
} else {
if (In_Array(null || false, $Arguments)) {
$ErrorMessage = 'One of the arguments is invalid and/or missing.';
return false;
} else {
if ($Arguments['openid_claimed_id'] !== $Arguments['openid_identity']) {
$ErrorMessage = 'Claimed id must match your identity.';
return false;
} else {
if (strpos($Arguments['openid_return_to'], $SelfURL) !== 0) {
$ErrorMessage = 'Invalid return uri.';
return false;
}
}
}
}
if (Preg_Match('/^https?:\\/\\/steamcommunity.com\\/openid\\/id\\/(7656119[0-9]{10})\\/?$/', $Arguments['openid_identity'], $CommunityID) === 1) {
$CommunityID = $CommunityID[1];
} else {
$ErrorMessage = 'Failed to find your CommunityID. If this issue persists, please contact us.';
return false;
}
$Arguments['openid_mode'] = 'check_authentication';
// Add mode for verification
$c = cURL_Init();
cURL_SetOpt_Array($c, array(CURLOPT_USERAGENT => 'Steam Database Party OpenID Login', CURLOPT_RETURNTRANSFER => true, CURLOPT_URL => self::STEAM_LOGIN, CURLOPT_CONNECTTIMEOUT => 6, CURLOPT_TIMEOUT => 6, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $Arguments));
$Response = cURL_Exec($c);
cURL_Close($c);
if (Preg_Match('/is_valid\\s*:\\s*true/', $Response) === 1) {
return $CommunityID;
}
// If we reach here, then it failed
$ErrorMessage = 'Failed to verify your login with Steam, it could be down. Check Steam\'s status at http://steamstat.us.';
return false;
}
示例12: filterAvailablePrefixFilters
static function filterAvailablePrefixFilters($arr_filter)
{
if (self::IsWPMLActive() && Is_Array($arr_filter)) {
foreach ($arr_filter as $index => $filter) {
# Check if there are posts behind this filter in this language
$query = new \WP_Query(array('post_type' => Post_Type::$post_type_name, 'post_title_like' => $filter . '%', 'posts_per_page' => 1));
if (!$query->Have_Posts()) {
unset($arr_filter[$index]);
}
}
}
return $arr_filter;
}
示例13: send
public function send($Mobile, $Message)
{
#-------------------------------------------------------------------------------
$Result = $this->sendSmsCmd($Mobile, $Message);
if (Is_Array($Result)) {
$this->success = SPrintF('id = %s; cnt = %s', $Result['id'], $Result['cnt']);
return TRUE;
}
#-------------------------------------------------------------------------------
$this->error = print_r($Result, true);
return $Result;
#-------------------------------------------------------------------------------
}
示例14: getParams
public function getParams()
{
#-------------------------------------------------------------------------------
#$Server = DB_Select('HostingServers', Array('Address', 'Url', 'Ns1Name', 'Ns2Name', 'MySQL'), Array('UNIQ', 'ID' => $this->params['ServerID']));
$Server = DB_Select('Servers', array('Address', 'Params'), array('UNIQ', 'Where' => SPrintF('(SELECT `ServerID` FROM `OrdersOwners` WHERE `OrdersOwners`.`ID` = %u) = `Servers`.`ID`', $this->params['OrderID'])));
if (!Is_Array($Server)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$this->params['Server'] = $Server;
#-------------------------------------------------------------------------------
return $this->params;
#-------------------------------------------------------------------------------
}
示例15: Table_Super_Replace
function Table_Super_Replace($Array, $Matches)
{
#---------------------------------------------------------------------------
$Result = array();
#---------------------------------------------------------------------------
if (Is_Array($Array)) {
#-------------------------------------------------------------------------
foreach (Array_Keys($Array) as $ElementID) {
#-----------------------------------------------------------------------
$Element = $Array[$ElementID];
#-----------------------------------------------------------------------
$Result[$ElementID] = Is_Array($Element) ? Table_Super_Replace($Element, $Matches) : Str_Replace(Array_Keys($Matches), Array_Values($Matches), $Element);
}
}
#---------------------------------------------------------------------------
return $Result;
}