• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP in_array_r函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: add

 public function add()
 {
     $this->check_authority();
     if (isset($_POST['wid_id']) and isset($_POST['parent'])) {
         $wid_id = $_POST['wid_id'];
         $area = $_POST['parent'];
         $this->load->model('mwidget');
         $this->load->model('msettings');
         $gen_settings = $this->msettings->get_set_gen();
         $wid_areas = get_layout_wid_areas($gen_settings[0]->theme);
         $area_wids = get_widgets($area);
         $wid_list = $this->mwidget->get_widget_list();
         if (null != $this->mwidget->get_widget_list($wid_id) and in_array_r($area, $wid_areas)) {
             $wid_info = $this->mwidget->get_widget_list($wid_id);
             $title = $wid_info[0]->desc;
             $xtbl = $wid_info[0]->child_tbl;
             $pos = count($area_wids) + 1;
             $add = $this->mwidget->add_widget($wid_id, $title, $area, $pos, $xtbl);
             if (true == $add) {
                 $data['wid_list'] = $this->mwidget->get_widget_list();
                 $data['wid_area_wids'] = get_widgets($area);
                 $this->load->view($this->wid_dir . 'widgets_list', $data);
             }
         }
     }
 }
开发者ID:Cavalero,项目名称:CORA,代码行数:26,代码来源:widget.php


示例2: in_array_r

function in_array_r($needle, $haystack, $strict = false)
{
    foreach ($haystack as $item) {
        if (($strict ? $item === $needle : $item == $needle) || is_array($item) && in_array_r($needle, $item, $strict)) {
            return true;
        }
    }
    return false;
}
开发者ID:EJOweb,项目名称:ejo-featured-widget,代码行数:9,代码来源:helpers.php


示例3: in_array_r

 function in_array_r($needle, $haystack)
 {
     foreach ($haystack as $item) {
         if ($item === $needle || is_array($item) && in_array_r($needle, $item)) {
             return true;
         }
     }
     return false;
 }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:9,代码来源:BooksForReviewHandler.inc.php


示例4: in_array_r

/**
 * Recursive in_array function
 *
 * @param  array $needle
 * @param  array $haystack
 * @return boolean
 */
function in_array_r($needle, $haystack)
{
    if (!is_array($needle)) {
        return in_array_r(array($needle), $haystack);
    }
    foreach ($needle as $item) {
        if (in_array($item, $haystack)) {
            return true;
        }
    }
    return false;
}
开发者ID:videouri,项目名称:videouri-old,代码行数:19,代码来源:commons_helper.php


示例5: in_array_r

 private function in_array_r($needle, $haystack)
 {
     $found = false;
     foreach ($haystack as $item) {
         if ($item === $needle) {
             $found = true;
             break;
         } elseif (is_array($item)) {
             $found = in_array_r($needle, $item);
             if ($found) {
                 break;
             }
         }
     }
     return $found;
 }
开发者ID:m-ferrara,项目名称:wia,代码行数:16,代码来源:display_model.php


示例6: form

 public function form($instance)
 {
     // Extracting defined values and defining default values for variables
     $instance = wp_parse_args((array) $instance, array('title' => '', 'features' => array(), 'url' => ''));
     // $title 				= esc_attr( $instance['title'] );
     $url = esc_url($instance['url']);
     $active_features = $instance['features'];
     // Store all active features first in (array) $all_features
     $all_features = $active_features;
     // Append non-active features to (array) $all_features
     foreach ($this->feature_list as $feature) {
         if (!in_array_r($feature, $active_features)) {
             $all_features[] = array('name' => $feature);
         }
     }
     // Display the admin form
     include plugin_dir_path(__FILE__) . 'inc/admin-widget.php';
 }
开发者ID:EJOweb,项目名称:ejo-featured-widget,代码行数:18,代码来源:ejo-featured-widget.php


示例7: parseNavArray

function parseNavArray($nav_array, $page_url, $level = 1)
{
    $output = "";
    foreach ($nav_array as $nav_title => $nav_url) {
        if (is_array($nav_url)) {
            $nav_class = '';
            if (in_array_r($page_url, $nav_url)) {
                $nav_class = ' active';
            }
            // end if (in_array_r($page_url, $nav_url))
            if ($level == 1) {
                $output .= '<li class="dropdown' . $nav_class . '">' . '<a class="dropdown-toggle" data-toggle="dropdown">' . $nav_title . ' <b class="caret"></b>' . '</a>' . '<ul class="dropdown-menu">' . parseNavArray($nav_url, $page_url, $level + 1) . '</ul>' . '</li>';
            } else {
                // end if ($level == 1)
                $output .= '<li class="dropdown-submenu">' . '<a>' . $nav_title . '</a>' . '<ul class="dropdown-menu">' . parseNavArray($nav_url, $page_url, $level + 1) . '</ul>' . '</li>';
            }
            // end if ($level == 1) else
        } else {
            if ($nav_url == "divider") {
                // end if (is_array($nav_url))
                $output .= '<li class="divider"></li>';
            } else {
                if ($nav_url == $page_url) {
                    // end if ($nav_url == "divider")
                    if ($level == 1) {
                        $output .= '<li class="active"><a>' . $nav_title . '</a></li>';
                    } else {
                        // end if ($level == 1)
                        $output .= '<li class="disabled"><a>' . $nav_title . '</a></li>';
                    }
                    // end if ($level == 1) else
                } else {
                    // end if ($nav_url == $page_url)
                    $output .= '<li><a href="' . $nav_url . '">' . $nav_title . '</a></li>';
                }
            }
        }
        // end if ($nav_url == $page_url) else
    }
    // end foreach ($nav_array as $nav_title => $nav_url)
    return $output;
}
开发者ID:amumu,项目名称:FB-fan-page-analysis,代码行数:42,代码来源:navbar.php


示例8: subcategorias

 static function subcategorias($client)
 {
     if (self::tieneCatCustom($client)) {
         $cats = self::categoriasCustom($client);
         $c = array();
         foreach ($cats['data'] as $cat) {
             if ($cat['activo'] == 1 && !in_array_r($cat['subcategoria'], $c)) {
                 $c[] = array('categoria' => $cat['categoria'], 'subcategoria' => $cat['subcategoria']);
             }
         }
         return $c;
     } else {
         PDOSql::$pdobj = pdoConnect();
         $cats = Sql::fetch("SELECT categoria, subcategoria from cats ORDER BY id ASC");
         $c = array();
         foreach ($cats as $cat) {
             if (!in_array_r($cat['subcategoria'], $c)) {
                 $c[] = array('categoria' => $cat['categoria'], 'subcategoria' => $cat['subcategoria']);
             }
         }
         return $c;
     }
 }
开发者ID:scabros,项目名称:scabrosfw,代码行数:23,代码来源:Collections.php


示例9: checkDB

 /**
  * Datenbank pruefen
  *
  * *Description* Pruefe bei Systemstart ob alle notwendigen Tabellen und Spalten angelegt sind 
  * 
  * @param string
  *
  * @return array
  */
 public function checkDB($setting = 'complete')
 {
     $missing = array('error' => FALSE, 'message' => NULL);
     $tableCols = parent::dbStrukture('cols');
     // Prüfe ob Tabellen existieren
     $stmt = $this->db->query("SHOW TABLES");
     $tables = $stmt->fetchAll(\PDO::FETCH_ASSOC);
     if (!empty($tables)) {
         foreach (parent::dbStrukture('tables') as $table) {
             if (in_array_r(TBL_PRFX . $table, $tables)) {
                 // Prüfe ob alle Spalten existieren bei complete
                 if ($setting != 'short') {
                     $stmt = $this->db->query("SHOW COLUMNS FROM " . TBL_PRFX . $table);
                     $columns = $stmt->fetchAll(\PDO::FETCH_COLUMN);
                     if (!empty($columns)) {
                         foreach ($tableCols[$table] as $column) {
                             if (!in_array_r($column, $columns)) {
                                 $missing['message'][] = 'missing column ' . $column . ' in table ' . $table;
                             }
                         }
                     } else {
                         $missing['message'][] = 'missing all cols in table ' . $table;
                     }
                 }
             } else {
                 $missing['message'][] = 'missing table ' . $table;
             }
         }
     } else {
         $missing['message'][] = 'missing all tables';
     }
     if (!empty($missing['message'])) {
         $missing['error'] = TRUE;
     }
     return $missing;
 }
开发者ID:alexanderweigelt,项目名称:Surftime-3.0.3,代码行数:45,代码来源:GetContent.php


示例10: bbconnect_process_country

function bbconnect_process_country($country)
{
    $bbconnect_helper_country = bbconnect_helper_country();
    if (strlen($country) > 3) {
        $country = in_array_r($country, $bbconnect_helper_country, true);
    } else {
        $country = substr($country, 0, 2);
    }
    return $country;
}
开发者ID:whatthefork,项目名称:bbconnect,代码行数:10,代码来源:bbconnect-users.php


示例11: sc_ra_ads

 function sc_ra_ads($name)
 {
     if (qw_hook_exist(__FUNCTION__)) {
         $args = func_get_args();
         array_unshift($args, $this);
         return qw_event_hook(__FUNCTION__, $args, NULL);
     }
     $option = ra_opt('ra_qaads');
     if (is_array($option)) {
         if (in_array_r($name, $option)) {
             foreach ($option as $opt) {
                 if (ra_edit_mode() && $opt['name'] == $name) {
                     $this->output('<div style="height:100px;background:#333;text-align:center;font-size:20px;margin-bottom:20px;">', $opt['name'], '</div>');
                 } elseif ($opt['name'] == $name) {
                     $this->output(str_replace('\\', '', base64_decode($opt['code'])));
                 }
             }
         } else {
             $this->output('No ads code found with this name');
         }
     }
 }
开发者ID:rahularyan,项目名称:dude-theme,代码行数:22,代码来源:blocks.php


示例12: _build_links


//.........这里部分代码省略.........
         }
         $item['attributes']['target'] = $link['target'] ? 'target="' . $link['target'] . '"' : null;
         $item['attributes']['class'] = $link_class ? 'class="' . $link_class . '"' : '';
         // attributes of anchor wrapper
         $wrapper['class'] = $link['class'] ? explode(' ', $link['class']) : array();
         $wrapper['children'] = $return_arr ? array() : null;
         $wrapper['separator'] = $separator;
         // is single ?
         if ($total === 1) {
             $wrapper['class'][] = 'single';
         } elseif ($i === 1) {
             $wrapper['class'][] = $first_class;
         } elseif ($i === $total) {
             $wrapper['class'][] = $last_class;
             $wrapper['separator'] = '';
         }
         // has children ? build children
         if ($link['children']) {
             ++$level;
             if (!$max_depth or $level < $max_depth) {
                 $wrapper['class'][] = $more_class;
                 $wrapper['children'] = $this->_build_links($link['children'], $return_arr);
             }
             --$level;
         }
         // is this the link to the page that we're on?
         if (preg_match('@^' . current_url() . '/?$@', $link['url']) or $link['link_type'] == 'page' and $link['is_home'] and site_url() == current_url()) {
             $current_link = $link['url'];
             $wrapper['class'][] = $current_class;
         }
         // Is this page a parent of the current page?
         // Get the URI and compare
         $uri_segments = explode('/', str_replace(site_url(), '', $link['url']));
         foreach ($uri_segments as $k => $seg) {
             if (!$seg) {
                 unset($uri_segments[$k]);
             }
         }
         $short_segments = array_slice($this->uri->segment_array(), 0, count($uri_segments));
         if (!array_diff($short_segments, $uri_segments)) {
             $wrapper['class'][] = $parent_class;
         }
         // is the link we're currently working with found inside the children html?
         if (!in_array($current_class, $wrapper['class']) and isset($wrapper['children']) and $current_link and (is_array($wrapper['children']) and in_array_r($current_link, $wrapper['children']) or is_string($wrapper['children']) and strpos($wrapper['children'], $current_link))) {
             // that means that this link is a parent
             $wrapper['class'][] = 'has_' . $current_class;
         } elseif ($link['module_name'] === $this->module and !preg_match('@^' . current_url() . '/?$@', $link['url'])) {
             $wrapper['class'][] = 'has_' . $current_class;
         }
         ++$i;
         if ($return_arr) {
             $item['target'] =& $item['attributes']['target'];
             $item['class'] =& $item['attributes']['class'];
             $item['children'] = $wrapper['children'];
             if ($wrapper['class'] && $item['class']) {
                 $item['class'] = implode(' ', $wrapper['class']) . ' ' . substr($item['class'], 7, -1);
             } elseif ($wrapper['class']) {
                 $item['class'] = implode(' ', $wrapper['class']);
             }
             if ($item['target']) {
                 $item['target'] = substr($item['target'], 8, -1);
             }
             // assign attributes to level family
             $output[] = $item;
         } else {
             $add_first_tag = $level === 0 && !in_array($this->attribute('items_only', 'true'), array('1', 'y', 'yes', 'true'));
             // render and indent or only render inline?
             if ($indent) {
                 // remove all empty values so we don't have an empty class attribute
                 $classes = implode(' ', array_filter($wrapper['class']));
                 $output .= $add_first_tag ? "<{$list_tag}>" . PHP_EOL : '';
                 $output .= $ident_b . '<' . $tag . ($classes > '' ? ' class="' . $classes . '">' : '>') . PHP_EOL;
                 $output .= $ident_c . (($level == 0 and $top == 'text' and $wrapper['children']) ? $item['title'] : anchor($item['url'], $item['title'], trim(implode(' ', $item['attributes'])))) . PHP_EOL;
                 if ($wrapper['children']) {
                     $output .= $ident_c . "<{$list_tag}>" . PHP_EOL;
                     $output .= $ident_c . $indent . str_replace(PHP_EOL, PHP_EOL . $indent, trim($ident_c . $wrapper['children'])) . PHP_EOL;
                     $output .= $ident_c . "</{$list_tag}>" . PHP_EOL;
                 }
                 $output .= $wrapper['separator'] ? $ident_c . $wrapper['separator'] . PHP_EOL : '';
                 $output .= $ident_b . "</{$tag}>" . PHP_EOL;
                 $output .= $add_first_tag ? $ident_a . "</{$list_tag}>" . PHP_EOL : '';
             } else {
                 // remove all empty values so we don't have an empty class attribute
                 $classes = implode(' ', array_filter($wrapper['class']));
                 $output .= $add_first_tag ? "<{$list_tag}>" : '';
                 $output .= '<' . $tag . ($classes > '' ? ' class="' . $classes . '">' : '>');
                 $output .= ($level == 0 and $top == 'text' and $wrapper['children']) ? $item['title'] : anchor($item['url'], $item['title'], trim(implode(' ', $item['attributes'])));
                 if ($wrapper['children']) {
                     $output .= '<' . $list_tag . ' class="' . $dropdown_class . '">';
                     $output .= $wrapper['children'];
                     $output .= "</{$list_tag}>";
                 }
                 $output .= $wrapper['separator'];
                 $output .= "</{$tag}>";
                 $output .= $add_first_tag ? "</{$list_tag}>" : '';
             }
         }
     }
     return $output;
 }
开发者ID:nockout,项目名称:tshpro,代码行数:101,代码来源:plugin.php


示例13: htmlspecialchars

     $package_name = htmlspecialchars($item['name']);
     $package = $queries->getWhere('donation_packages', array('name', '=', $package_name));
     if (!count($package)) {
         // No, it doesn't exist
         $package_id = $item['id'];
         $package_category = $item['categoryid'];
         $package_description = htmlspecialchars($item['description']);
         $package_price = $item['price'];
         $package_url = htmlspecialchars($item['url']);
         $queries->create('donation_packages', array('name' => $package_name, 'description' => $package_description, 'cost' => $package_price, 'package_id' => $package_id, 'active' => 1, 'package_order' => 0, 'category' => $package_category, 'url' => $package_url));
     }
 }
 // Delete any packages which don't exist on the web store anymore
 $packages = $queries->getWhere('donation_packages', array('id', '<>', 0));
 foreach ($packages as $package) {
     if (!in_array_r($package->package_id, $mm_gui['result'])) {
         // It doesn't exist anymore
         $queries->delete('donation_packages', array('id', '=', $package->id));
     }
 }
 /*
  * DONORS SYNC
  */
 foreach ($mm_donors['result'] as $item) {
     // Does it already exist in the database?
     $date = date('Y-m-d H:i:s', strtotime($item['date']));
     $donor_query = $queries->getWhere('buycraft_data', array('time', '=', $date));
     if (count($donor_query)) {
         // Already exists, we can stop now
         break;
     }
开发者ID:daddysboy2001,项目名称:NamelessMC,代码行数:31,代码来源:execute_donate_sync.php


示例14: in_array_r

function in_array_r($needle, $haystack, $strict = true)
{
    $override = apply_filters('pre_in_array_r', false, $needle, $haystack, $strict);
    if ($override !== false) {
        return $override;
    }
    foreach ($haystack as $item) {
        if (($strict ? $item === $needle : $item == $needle) || is_array($item) && in_array_r($needle, $item, $strict)) {
            return true;
        }
    }
    return false;
}
开发者ID:KevinFairbanks,项目名称:Nebula,代码行数:13,代码来源:nebula_utilities.php


示例15: updatecycleV3

function updatecycleV3()
{
    $db_server = mysqli_connect("localhost", "root", "root", "schedule");
    if (mysqli_connect_errno()) {
        printf("Connect failed: %s\n", mysqli_connect_error());
        exit;
    }
    $today = date('Y-m-d');
    //Here's the goal of V3 - take all inactive days. then run the usual update sequence checking only if a day is a weekend or on the inactive array
    $findoffdays = "SELECT daate FROM days where active = 'n';";
    $offdaysresult = mysqli_query($db_server, $findoffdays);
    if ($findoffdays->connect_errno) {
        echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
    }
    $offdays_array = mysqli_fetch_all($offdaysresult, MYSQLI_NUM);
    mylog(print_r($offdays_array, true));
    $x = 1;
    $cyc_array = array('A', 'B', 'C', 'D', 'E', 'F');
    $letter = 'A';
    $cyc = 0;
    while ($x <= 200) {
        $startdate = "2016-01-04";
        $dategivenbyadmin = strtotime($startdate);
        $formatteddateforcondish = date('Y-m-d', $dategivenbyadmin);
        mylog("{$dategivenbyadmin} is the DATE GIVEN BY ADMIN");
        $nextday = date('Y-m-d', strtotime("+ {$x} days", "{$dategivenbyadmin}"));
        mylog("{$x} days after {$dategivenbyadmin} is {$nextday}");
        //$activeday = checkforinactiveday($nextday);
        //if it's a weekend, skip
        if (date('D', strtotime("+ {$x} days", "{$dategivenbyadmin}")) === "Sun" || date('D', strtotime("+ {$x} days", "{$dategivenbyadmin}")) === "Sat") {
            mylog("{$nextday} is a weekend 395");
            $x = $x + 1;
        } elseif (in_array_r($nextday, $offdays_array, true)) {
            mylog("{$nextday} is in the {$offdays} list");
            $x = $x + 1;
        } else {
            $letter = $cyc_array[$cyc];
            //mylog("should be starting with $letter");
            $cyc = $cyc == 5 ? 0 : $cyc + 1;
            mylog("the cyc value for {$nextday} should be {$cyc}");
            mylog("the letter value for {$nextday} should be {$letter}");
            $dayquery = "UPDATE days SET cycleday = '{$letter}', daymodified = '{$today}' WHERE daate = '{$nextday}';";
            mylog("update query looks like {$dayquery}");
            $dayqueryresult = mysqli_query($db_server, $dayquery);
            mylog('ran the inactive day query');
            if ($dayqueryresult->connect_errno) {
                echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
            }
            $x = $x + 1;
            //$cyc = $cyc + 1;
        }
    }
}
开发者ID:jack-crawford,项目名称:Schedule-Project,代码行数:53,代码来源:post.php


示例16: cms

 public function cms()
 {
     $questionnaire_id = $this->session->userdata('questionnaire_id');
     if (!$questionnaire_id) {
         show_404();
     }
     // Load the rules arrays
     $this->config->load('form_validation');
     $cms_rules = $this->config->item('cms_rules');
     $key_services_rules = $this->config->item('key_services_rules');
     $reference_websites_rules = $this->config->item('reference_websites_rules');
     $website_images_rules = $this->config->item('website_images_rules');
     $this->load->library('form_validation');
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger" role="alert">', '</div>');
     // Create additional validation rules from the key services rules
     foreach ($key_services_rules as $key_services_rule) {
         $field_name_template = $key_services_rule['field'];
         $field_name = str_replace('%d', '', $field_name_template);
         // Skip the descriptive label which will not have a field name set
         if ($field_name_template) {
             $this->form_validation->set_rules($field_name, $key_services_rule['label'], $key_services_rule['rules']);
         }
     }
     // Create additional validation rules from the reference websites rules
     foreach ($reference_websites_rules as $reference_websites_rule) {
         $field_name_template = $reference_websites_rule['field'];
         $field_name = str_replace('%d', '', $field_name_template);
         // Skip the descriptive label which will not have a field name set
         if ($field_name_template) {
             $this->form_validation->set_rules($field_name, $reference_websites_rule['label'], $reference_websites_rule['rules']);
         }
     }
     // Create additional validation rules from the website images rules
     foreach ($website_images_rules as $website_images_rule) {
         $field_name_template = $website_images_rule['field'];
         $field_name = str_replace('%d', '', $field_name_template);
         // Skip the descriptive label which will not have a field name set
         if ($field_name_template) {
             $this->form_validation->set_rules($field_name, $website_images_rule['label'], $website_images_rule['rules']);
         }
     }
     // Main CMS Validation
     if ($this->form_validation->run('cms_rules') == TRUE) {
         $this->load->helper('array');
         $blank_elements = 0;
         $total_elements = 0;
         /* Process the answers for Key Services */
         $processed = $this->process_key_services($this->input->post('company_key_services'), $questionnaire_id);
         $blank_elements += $processed ? 0 : 1;
         $total_elements++;
         /* Process the answers for Website Function */
         $processed = $this->process_website_function($this->input->post('website_function'), $questionnaire_id);
         $blank_elements += $processed ? 0 : 1;
         $total_elements++;
         /* Process the answers for Reference Websites */
         $processed = $this->process_reference_websites($this->input->post('company_reference_websites'), $questionnaire_id);
         $blank_elements += $processed ? 0 : 1;
         $total_elements++;
         /* Process the answers for Website Images */
         $processed = $this->process_website_images($this->input->post('company_website_images'), $questionnaire_id);
         $blank_elements += $processed ? 0 : 1;
         $total_elements++;
         $form_data = $this->input->post();
         unset($form_data['website_function']);
         // Process CMS Answers
         foreach ($form_data as $form_element => $form_element_value) {
             // Append array brackets to names of arrays
             if (is_array($form_data[$form_element])) {
                 $form_element_name = "{$form_element}[]";
             } else {
                 $form_element_name = $form_element;
             }
             // Remove any form elements that are not CMS form elements
             if (!in_array_r($form_element_name, $cms_rules)) {
                 unset($form_data[$form_element]);
                 continue;
             }
             // Remove any 'other' elements if empty or where the parent element is not set
             if (substr($form_element, -6) == '_other') {
                 $parent_element = substr($form_element, 0, -6);
                 if (empty($form_element_value) || array_key_exists($parent_element, $form_data) === false) {
                     unset($form_data[$form_element]);
                     continue;
                 }
             }
             // Remove the 'IE Version' element if empty or where the parent element is not set
             if ($form_element == 'your_browser_ie') {
                 if (empty($form_element_value) || array_key_exists('your_browser', $form_data) === false) {
                     unset($form_data[$form_element]);
                     continue;
                 }
             }
             // Set any empty values to NULL
             if (empty($form_element_value)) {
                 $form_data[$form_element] = null;
             }
         }
         // Save CMS Answers to database
         $progress = $this->cms_answers_model->save_cms_answers($questionnaire_id, $form_data, $blank_elements, $total_elements);
         $this->load->model('questionnaires_model');
//.........这里部分代码省略.........
开发者ID:AdrianBav,项目名称:ee-questionnaire,代码行数:101,代码来源:questions.php


示例17: get_posts

<div class="container">
    <h1>Рекомендуемые товары</h1>
    <form action="/wp-admin/admin.php?page=recommend" method="post">
    <?php 
$myposts = get_posts(array('post_type' => 'product', 'pots_per_page' => -1));
foreach ($myposts as $mypost) {
    if (in_array_r($mypost->ID, $ids)) {
        echo '<p><input type="checkbox" name="recommended[]" checked value="' . $mypost->ID . '">' . $mypost->post_title . '</p>';
    } else {
        echo '<p><input type="checkbox" name="recommended[]" value="' . $mypost->ID . '">' . $mypost->post_title . ' </p>';
    }
}
?>
    <input type="submit" value="Сохранить">
    </form>
</div>
开发者ID:Kirbaba,项目名称:SushiLife,代码行数:16,代码来源:recommend.php


示例18: fi_info_shared

function fi_info_shared($d, $id)
{
    $sh = in_array_r($_SESSION['curdir'], $d, 0);
    $j = 'fifunc___fi*';
    $dj = ajx($d) . '_' . $id;
    if ($sh) {
        $t = nms(74);
    } else {
        $t = nms(75);
    }
    $c = $sh ? 'color:#bd0000' : '';
    $ret .= blj('', $id . 'fishr', $j . 'share_' . $dj, picto('share', $c));
    if ($sh) {
        $ret .= blj('', $id . 'fivrd', $j . 'vdir_' . $sh . '_' . $id, fi_pic('virtual_dir')) . ' ';
    }
    return $ret;
}
开发者ID:philum,项目名称:cms,代码行数:17,代码来源:finder.php


示例19: bbconnect_rows


//.........这里部分代码省略.........
        $tempTotals = array();
        foreach ($table_body as $key => $value) {
            //declare an empty array to hold temporal total values
            $positionInarray++;
            // HORRIBLY HACKISH MANIPULATIONS FOR ADDRESSES...
            if (false != strstr($key, 'address')) {
                // THE KEY WITH THE NUMERIC IDENTIFIER
                $origkey = $key;
                // THE NUMERIC IDENTIFIER
                $thiskey = str_replace('_', '', substr($key, -2));
                // THE KEY WITH THE NUMERIC IDENTIFIER REMOVED
                if (is_numeric($thiskey)) {
                    $key = substr($key, 0, -2);
                }
            }
            // SET THE ARRAY KEY
            //if ( isset( $post_vars['search'] ) )
            //$thiskey = in_array_r($value, $post_vars['search'], true);
            if (false == $return) {
                $align = is_numeric($current_member->{$key}) ? 'right' : 'right';
                $return_html .= '<td width="' . $tdw . '%" style="text-align: ' . $align . ';">';
                //$return_html .= $key . ' ' . $value;
            }
            // TAXONOMIES
            if (is_array($value)) {
                // KEYS USED AS OBJECT VARS CANNOT HAVE DASHES
                $alt_key = str_replace('-', '', $key);
                if (!empty($current_member->{$key})) {
                    foreach ($current_member->{$key} as $subkey => $subvalue) {
                        if ('bbconnect' == substr($key, 0, 9)) {
                            $key = substr($key, 10);
                        }
                        $term_name = get_term_by('id', $subvalue, $key);
                        if (in_array_r($subvalue, $value)) {
                            $ret_arr[] = '<span class="highlight">' . $term_name->name . '</span>';
                        } else {
                            $ret_arr[] = $term_name->name;
                        }
                    }
                } else {
                    if (!empty($current_member->{$alt_key})) {
                        foreach ($current_member->{$alt_key} as $subkey => $subvalue) {
                            $term_name = get_term_by('id', $subvalue, substr($key, 10));
                            if (in_array_r($subvalue, $value)) {
                                $ret_arr[] = '<span class="highlight">' . $term_name->name . '</span>';
                            } else {
                                $ret_arr[] = $term_name->name;
                            }
                        }
                    } else {
                        $ret_arr = '';
                        //bbconnect_grex_input( array( 'u_key' => $current_member->ID, 'g_key' => $key, 'g_val' => $current_member->$key ) );
                    }
                }
                if (false == $return) {
                    if (!is_array($ret_arr)) {
                        $return_html .= '';
                        //$return_html .= bbconnect_grex_input( array( 'u_key' => $current_member->ID, 'g_key' => $key, 'g_val' => $current_member->$key ) );
                    } else {
                        $return_html .= implode(', ', $ret_arr);
                        //$return_html .= bbconnect_grex_input( array( 'u_key' => $current_member->ID, 'g_key' => $key, 'g_val' => strip_tags( implode( '|', $ret_arr ) ) ) );
                    }
                } else {
                    if (!is_array($ret_arr)) {
                        $return_val[$key] = $current_member->{$key};
                    } else {
开发者ID:whatthefork,项目名称:bbconnect,代码行数:67,代码来源:bbconnect-reports.php


示例20: db

/*
-----------------------------------------------------
    SAMP līmeņu spraudņa konfigurācija
-----------------------------------------------------
*/
$db = new db($samp['db']['host'], $samp['db']['username'], $samp['db']['password'], $samp['db']['database']);
if ($db->connected === false) {
    die(baltsms::alert("Nevar izveidot savienojumu ar MySQL serveri. Pārbaudi norādītos pieejas datus!", "danger"));
}
$lang[$p] = $c['lang'][$p][$c['page']['lang_personal']];
if (isset($_POST['code'])) {
    $errors = array();
    if (empty($_POST['nickname'])) {
        $errors[] = $lang[$p]['error_empty_nickname'];
    } else {
        if (in_array_r($_POST['nickname'], $samp['rcon'][$_POST['server']]->getBasicPlayers())) {
            $errors[] = $lang[$p]['error_inserver'];
        }
    }
    if (empty($_POST['server'])) {
        $errors[] = $lang[$p]['error_empty_server'];
    }
    if (empty($_POST['price']) and !empty($_POST['server'])) {
        $errors[] = $lang[$p]['error_empty_price'];
    } else {
        if (!isset($c[$p]['prices'][$_POST['server']][$_POST['price']])) {
            $errors[] = $lang[$p]['error_price_not_listed'];
        }
    }
    if (empty($_POST['code'])) {
        $errors[] = $lang[$p]['error_empty_code'];
开发者ID:ytteroy,项目名称:baltGro-shop,代码行数:31,代码来源:samp_levels.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP in_arrayi函数代码示例发布时间:2022-05-15
下一篇:
PHP in_array_nocase函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap