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

PHP str_replace_array函数代码示例

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

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



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

示例1: round

         } else {
             $disk_percent = 0;
             $disk_doublepercent = 0;
         }
         if ($row['traffic'] > 0) {
             $traffic_percent = round($row['traffic_used'] * 100 / $row['traffic'], 0);
             $traffic_doublepercent = round($traffic_percent * 2, 2);
         } else {
             $traffic_percent = 0;
             $traffic_doublepercent = 0;
         }
         $islocked = 0;
         if ($row['loginfail_count'] >= Settings::Get('login.maxloginattempts') && $row['lastlogin_fail'] > time() - Settings::Get('login.deactivatetime')) {
             $islocked = 1;
         }
         $row = str_replace_array('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps tickets subdomains');
         $row = htmlentities_array($row);
         // fix progress-bars if value is >100%
         if ($disk_percent > 100) {
             $disk_percent = 100;
         }
         if ($traffic_percent > 100) {
             $traffic_percent = 100;
         }
         $row['custom_notes'] = $row['custom_notes'] != '' ? nl2br($row['custom_notes']) : '';
         eval("\$customers.=\"" . getTemplate("customers/customers_customer") . "\";");
         $count++;
     }
     $i++;
 }
 $customercount = $num_rows;
开发者ID:mowamed,项目名称:Froxlor,代码行数:31,代码来源:admin_customers.php


示例2: formatMessage

 /**
  * 格式化sql错误信息
  *
  * @param  string  $sql
  * @param  array  $bindings
  * @param  \Exception $previous
  * @return string
  */
 protected function formatMessage($sql, $bindings, $previous)
 {
     return $previous->getMessage() . ' (SQL: ' . str_replace_array('\\?', $bindings, $sql) . ')';
 }
开发者ID:yb199478,项目名称:framework,代码行数:12,代码来源:QueryException.php


示例3: array

    $domainArray = array();
    while ($row = $db->fetch_array($result)) {
        $domainArray[] = $idna_convert->decode($row['domain']);
    }
    natsort($domainArray);
    $domains = implode(', ', $domainArray);
    $userinfo['email'] = $idna_convert->decode($userinfo['email']);
    $yesterday = time() - 60 * 60 * 24;
    $month = date('M Y', $yesterday);
    /*		$traffic=$db->query_first("SELECT SUM(http) AS http_sum, SUM(ftp_up) AS ftp_up_sum, SUM(ftp_down) AS ftp_down_sum, SUM(mail) AS mail_sum FROM ".TABLE_PANEL_TRAFFIC." WHERE year='".date('Y')."' AND month='".date('m')."' AND day<='".date('d')."' AND customerid='".$userinfo['customerid']."'");
    		$userinfo['traffic_used']=$traffic['http_sum']+$traffic['ftp_up_sum']+$traffic['ftp_down_sum']+$traffic['mail_sum'];*/
    $userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $settings['panel']['decimal_places']);
    $userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
    $userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
    $userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
    $userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains aps_packages');
    $opentickets = 0;
    $opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
                                   WHERE `customerid` = "' . $userinfo['customerid'] . '"
                                   AND `answerto` = "0"
                                   AND (`status` = "0" OR `status` = "2")
                                   AND `lastreplier`="1"');
    $awaitingtickets = $opentickets['count'];
    $awaitingtickets_text = '';
    if ($opentickets > 0) {
        $awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '<a href="customer_tickets.php?page=tickets&amp;s=' . $s . '">' . $opentickets['count'] . '</a>'));
    }
    eval("echo \"" . getTemplate("index/index") . "\";");
} elseif ($page == 'change_password') {
    if (isset($_POST['send']) && $_POST['send'] == 'send') {
        $old_password = validate($_POST['old_password'], 'old password');
开发者ID:HobbyNToys,项目名称:SysCP,代码行数:31,代码来源:customer_index.php


示例4: putIdsInPayload

 /**
  * @inheritdoc
  */
 public function putIdsInPayload($payload, array $ids, $randomIdString = '"{random_id}"')
 {
     return str_replace_array($randomIdString, $ids, $payload);
 }
开发者ID:larapackage,项目名称:randomid,代码行数:7,代码来源:Helper.php


示例5: round

             // For Traffic usage
             if ($row['traffic'] > 0) {
                 $traffic_percent = round($row['traffic_used'] * 100 / $row['traffic'], 0);
                 $traffic_doublepercent = round($traffic_percent * 2, 2);
             } else {
                 $traffic_percent = 0;
                 $traffic_doublepercent = 0;
             }
             // fix progress-bars if value is >100%
             if ($disk_percent > 100) {
                 $disk_percent = 100;
             }
             if ($traffic_percent > 100) {
                 $traffic_percent = 100;
             }
             $row = str_replace_array('-1', 'UL', $row, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains tickets');
             $row = htmlentities_array($row);
             $row['custom_notes'] = $row['custom_notes'] != '' ? nl2br($row['custom_notes']) : '';
             eval("\$admins.=\"" . getTemplate("admins/admins_admin") . "\";");
             $count++;
         }
         $i++;
     }
     $admincount = $numrows_admins;
     eval("echo \"" . getTemplate("admins/admins") . "\";");
 } elseif ($action == 'su') {
     $result_stmt = Database::prepare("\n\t\t\tSELECT * FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = :adminid\n\t\t");
     $result = Database::pexecute_first($result_stmt, array('adminid' => $id));
     $destination_admin = $result['loginname'];
     if ($destination_admin != '' && $result['adminid'] != $userinfo['userid']) {
         $result_stmt = Database::prepare("\n\t\t\t\tSELECT * FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = :userid\n\t\t\t");
开发者ID:asemen,项目名称:Froxlor,代码行数:31,代码来源:admin_admins.php


示例6: bindParameters

 /**
  * Bind parameters to a query.
  *
  * @param  string  $query
  * @param  array  $bindings
  * @return string
  */
 protected function bindParameters($query, array $bindings)
 {
     $database = $this->query;
     array_walk($bindings, function (&$binding) use($database) {
         $binding = is_integer($binding) ? (int) $binding : $database->connection()->getPdo()->quote($binding);
     });
     return str_replace_array('\\?', $bindings, $query);
 }
开发者ID:apolune,项目名称:core,代码行数:15,代码来源:TriggerHandler.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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