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

PHP mb_language函数代码示例

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

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



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

示例1: mailDefault

 function mailDefault($template, $to, $data)
 {
     $arrayMail = array();
     $file = file($template);
     //Get values from template mail
     foreach ($file as $value) {
         if ($value != "") {
             list($key, $val) = explode("=>", $value);
             $key = trim($key);
             $val = trim($val);
             $arrayMail[$key] = $val;
         }
     }
     $subject = $arrayMail['subject'];
     $from = $arrayMail['from'];
     $body = $arrayMail['body'];
     $body = str_replace('\\r\\n', "\n", $body);
     //			$headers .= "MIME-Version: 1.0\r\n";
     //			$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
     //			$headers  .= "From: $from\r\n";
     //push value from in parameter to body mail
     foreach ($data as $key => $item) {
         $body = str_replace('{$' . $key . '}', $item, $body);
     }
     //Execute send mail
     mb_language("Japanese");
     mb_internal_encoding("UTF-8");
     if (mb_send_mail($to, $subject, $body, "From: " . $from)) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:trongloikt192,项目名称:Project_Wahanda_Alternative,代码行数:33,代码来源:sendMail.php


示例2: sendMail

 /**
  * メール送信処理
  */
 private function sendMail()
 {
     //メールを送信する処理
     //    $mailer = jpSimpleMail::create('SwiftMailer4'); // このサンプルではSwift Mailerを利用しています。
     //    $mailer->setSubject('メール送信テストです');
     //    $mailer->setSender('[email protected]');
     //    $mailer->addTo(sprintf('%s <%s>', '宛先 太郎', '[email protected]'));
     //    $mailer->setFrom(sprintf('%s <%s>', '管理者', '[email protected]'));
     //    $mailer->setBody('本文です');
     ////    var_dump($mailer->getFrom());
     //    try{
     //    	$rs = $mailer->send();
     //    }catch(jpSendMailException $e){
     //    	echo 'exception';
     //    }
     //
     //    var_dump($rs);
     mb_language('ja');
     mb_internal_encoding('UTF-8');
     $to = sfConfig::get('sf_iquiry_mail');
     //宛先
     $subject = "お問い合わせ";
     //題名
     $body = $this->getRequestParameter('message');
     //本文
     $from = sfConfig::get('sf_iquiry_mail');
     //差出人
     //これでは文字化け!
     mail($to, $subject, $body, "From:" . $from);
 }
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:33,代码来源:actions.class.php


示例3: mail_to

 public static function mail_to($value, $mails)
 {
     //return md5($value);
     mb_language("japanese");
     mb_internal_encoding("utf-8");
     $email = mb_encode_mimeheader("チラシシステム") . "<[email protected]>";
     $subject = $value["title"];
     $body = $value["text"];
     //$from = "lightbox@sdc";
     //ini_set( "SMTP", "localhost" );
     //ini_set( "smtp_port", 25 );
     //ini_set( "sendmail_from", $from );
     $bccs = implode(' ,', $mails);
     $header = "From: " . mb_encode_mimeheader("チラシシステム") . "<[email protected]>";
     $header .= "\n";
     $header = "Bcc:" . $bccs;
     //$header ="Bcc:[email protected],[email protected]";
     $header .= "\n";
     if (!@mb_send_mail(NULL, $subject, $body, $header)) {
         // echo "*********mb_send_mailエラー**************";
         return false;
     } else {
         //echo "*********sucess**************";
         return true;
     }
 }
开发者ID:BGCX262,项目名称:zuozhenshi-prego-svn-to-git,代码行数:26,代码来源:Class_MAIL.php


示例4: initialize

 public function initialize()
 {
     $this->setMailer(new PHPMailer());
     mb_language('Ja');
     $this->setCharset('iso-2022-jp');
     $this->setEncoding('7bit');
 }
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:7,代码来源:jpPHPMailer.class.php


示例5: initMbstring

 static function initMbstring()
 {
     if (extension_loaded('mbstring')) {
         if (((int) ini_get('mbstring.encoding_translation') || in_array(strtolower(ini_get('mbstring.encoding_translation')), array('on', 'yes', 'true'))) && !in_array(strtolower(ini_get('mbstring.http_input')), array('pass', '8bit', 'utf-8'))) {
             user_error('php.ini settings: Please disable mbstring.encoding_translation or set mbstring.http_input to "pass"', E_USER_WARNING);
         }
         if (MB_OVERLOAD_STRING & (int) ini_get('mbstring.func_overload')) {
             user_error('php.ini settings: Please disable mbstring.func_overload', E_USER_WARNING);
         }
         mb_regex_encoding('UTF-8');
         ini_set('mbstring.script_encoding', 'pass');
         if ('utf-8' !== strtolower(mb_internal_encoding())) {
             mb_internal_encoding('UTF-8');
             ini_set('mbstring.internal_encoding', 'UTF-8');
         }
         if ('none' !== strtolower(mb_substitute_character())) {
             mb_substitute_character('none');
             ini_set('mbstring.substitute_character', 'none');
         }
         if (!in_array(strtolower(mb_http_output()), array('pass', '8bit'))) {
             mb_http_output('pass');
             ini_set('mbstring.http_output', 'pass');
         }
         if (!in_array(strtolower(mb_language()), array('uni', 'neutral'))) {
             mb_language('uni');
             ini_set('mbstring.language', 'uni');
         }
     } else {
         if (!defined('MB_OVERLOAD_MAIL')) {
             extension_loaded('iconv') or static::initIconv();
             require __DIR__ . '/Bootup/mbstring.php';
         }
     }
 }
开发者ID:pyjac,项目名称:BSSB,代码行数:34,代码来源:Bootup.php


示例6: noticePackageUploaded

 public function noticePackageUploaded(Package $pkg)
 {
     $app = $this->app;
     $package_url = mfwRequest::makeURL("/package?id={$pkg->getId()}");
     ob_start();
     include APP_ROOT . '/data/notice_mail_template.php';
     $body = ob_get_clean();
     $addresses = array();
     foreach ($this->rows as $r) {
         if ($r['notify']) {
             $addresses[] = $r['mail'];
         }
     }
     if (empty($addresses)) {
         return;
     }
     $subject = "New Package Uploaded to {$app->getTitle()}";
     $sender = Config::get('mail_sender');
     $to = $sender;
     $header = "From: {$sender}" . "\nBcc: " . implode(', ', $addresses);
     mb_language('uni');
     mb_internal_encoding('UTF-8');
     if (!mb_send_mail($to, $subject, $body, $header)) {
         throw new RuntimeException("mb_send_mail faild (pkg={$pkg->getId()}, {$pkg->getTitle()})");
     }
 }
开发者ID:kzfk,项目名称:emlauncher,代码行数:26,代码来源:InstallUser.php


示例7: exec

 /**
  * 
  * @param string $html
  */
 public function exec($html)
 {
     mb_language('Japanese');
     // 1.プリプロセス
     // scriptテキスト削除
     // script内に文字列リテラルの閉じタグがあるとDomDocumentがscriptのソースを#text扱いしてしまうので
     // script内の文字を削除する
     // 正規表現で削除しようとするとSegmentation faultが発生する(StackOverFlow?)ので
     // simple_html_domでscript内文字列を削除
     // MAX_FILE_SIZEの制限にひっかかったので、ソースを編集してデフォルトの3倍に変更している
     $simpleHtml = str_get_html($html);
     foreach ($simpleHtml->find('script') as $script) {
         $script->innertext = '';
     }
     $html = $simpleHtml->outertext;
     // トリム
     //		$html = preg_replace('/(\s| )+/mi', ' ', $html);
     // 2. dom生成
     $doc = new DomDocument("1.0", "utf-8");
     @$doc->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
     $node = $doc->getElementsByTagName('body')->item(0);
     $this->preProcessedInput = $node->textContent;
     // 3.プロパティを初期化
     $this->domXPath = new DomXPath($doc);
     $this->title = @$doc->getElementsByTagName('title')->item(0)->textContent;
     $text = $this->scan($node);
     $this->textAll = $text;
     $this->domCountAll = $this->domCount;
     $this->pancutuationCountAll = $this->calcKutenScore($text) + $this->calcTotenScore($text);
     $this->textLengthAll = mb_strlen($text);
     $this->highScore = -1000000;
     $this->extracedNode = null;
     // 4.実行
     $this->extract($node);
 }
开发者ID:gammodoking,项目名称:kindle.server,代码行数:39,代码来源:ContentExtractor.php


示例8: __construct

 /**
  * Constructor.
  *
  * @access protected
  */
 protected function __construct()
 {
     // Init Config
     Config::init();
     // Turn on output buffering
     ob_start();
     // Display Errors
     Config::get('system.errors.display') and error_reporting(-1);
     // Set internal encoding
     function_exists('mb_language') and mb_language('uni');
     function_exists('mb_regex_encoding') and mb_regex_encoding(Config::get('system.charset'));
     function_exists('mb_internal_encoding') and mb_internal_encoding(Config::get('system.charset'));
     // Set default timezone
     date_default_timezone_set(Config::get('system.timezone'));
     // Start the session
     Session::start();
     // Init Cache
     Cache::init();
     // Init Plugins
     Plugins::init();
     // Init Blocks
     Blocks::init();
     // Init Pages
     Pages::init();
     // Flush (send) the output buffer and turn off output buffering
     ob_end_flush();
 }
开发者ID:zorca,项目名称:morfy,代码行数:32,代码来源:Morfy.php


示例9: _setupMbstring

 function _setupMbstring()
 {
     #ifdef _MBSTRING_LANGUAGE
     if (defined('_MBSTRING_LANGUAGE') && function_exists("mb_language")) {
         if (@mb_language(_MBSTRING_LANGUAGE) != false && @mb_internal_encoding(_CHARSET) != false) {
             define('MBSTRING', true);
         } else {
             mb_language("neutral");
             mb_internal_encoding("ISO-8859-1");
             if (!defined('MBSTRING')) {
                 define('MBSTRING', false);
             }
         }
         if (function_exists('mb_regex_encoding')) {
             @mb_regex_encoding(_CHARSET);
         }
         ini_set('mbstring.http_input', 'pass');
         ini_set('mbstring.http_output', 'pass');
         ini_set('mbstring.substitute_character', 'none');
     }
     #endif
     if (!defined("MBSTRING")) {
         define("MBSTRING", FALSE);
     }
 }
开发者ID:nbuy,项目名称:legacy,代码行数:25,代码来源:Legacy_LanguageManager.class.php


示例10: execute

 /**
  * Mobile用クラス実行
  *
  * @access  public
  *
  */
 function execute()
 {
     $this->_container =& DIContainerFactory::getContainer();
     $this->_log =& LogFactory::getLog();
     $this->_filterChain =& $this->_container->getComponent("FilterChain");
     $this->_actionChain =& $this->_container->getComponent("ActionChain");
     $this->_db =& $this->_container->getComponent("DbObject");
     $this->_session =& $this->_container->getComponent("Session");
     $this->_request =& $this->_container->getComponent("Request");
     $this->_modulesView =& $this->_container->getComponent("modulesView");
     //$this->_mobile_obj = $this->_modulesView->getModuleByDirname("mobile");
     $this->_usersView =& $this->_container->getComponent("usersView");
     //mb_stringがロードされているかどうか
     if (!extension_loaded('mbstring') && !function_exists("mb_convert_encoding")) {
         include_once MAPLE_DIR . '/includes/mbstring.php';
     } else {
         if (function_exists("mb_detect_order")) {
             mb_detect_order(_MB_DETECT_ORDER_VALUE);
         }
     }
     if (function_exists("mb_internal_encoding")) {
         mb_internal_encoding(INTERNAL_CODE);
     }
     if (function_exists("mb_language")) {
         mb_language("Japanese");
     }
     $this->_log->trace("{$this->_classname}の前処理が実行されました", "{$this->_classname}#execute");
     $this->_preFilter();
     $this->_filterChain->execute();
     $this->_log->trace("{$this->_classname}の後処理が実行されました", "{$this->_classname}#execute");
     $this->_postFilter();
 }
开发者ID:RikaFujiwara,项目名称:NetCommons2,代码行数:38,代码来源:Filter_Mobile.class.php


示例11: run

 /**
  * Run an application
  */
 public static function run()
 {
     // Error reporting
     error_reporting(ENV === 'production' ? E_ERROR | E_WARNING | E_PARSE : -1);
     ini_set('display_errors', ENV === 'production' ? 0 : 1);
     // Services
     $services = Services::getInstance();
     // Global configuration
     $config = $services->config()->get('config');
     // UTF-8 support
     if (isset($config['utf8']) && $config['utf8']) {
         mb_internal_encoding('UTF-8');
         mb_http_output('UTF-8');
         mb_http_input('UTF-8');
         mb_language('uni');
         mb_regex_encoding('UTF-8');
         ob_start('mb_output_handler');
     } else {
         ob_start();
     }
     // Set Locales
     if (isset($config['locale']) && $config['locale']) {
         setlocale(LC_ALL, $config['locale']);
         setlocale(LC_NUMERIC, 'C');
     }
     // Call controller
     if ($route = $services->route()) {
         list($class, $method, $params) = $route;
         $controller = new $class();
         $controller->{$method}(...$params);
     }
     $services->output()->display(!$services->input()->isClient());
     ob_end_flush();
 }
开发者ID:sugatasei,项目名称:beerawecka,代码行数:37,代码来源:Bootstrap.php


示例12: resultAction

 public function resultAction()
 {
     $post = $this->request->getPost();
     $email = $post["email"];
     $error = array();
     if ("" == $email) {
         array_push($error, "メールアドレスを入力してください");
     } else {
         $pre_user_id = uniqid(rand(100, 999));
         $userModel = new Users();
         $result = $userModel->addEmail(array($pre_user_id, $email));
         if (false == $result) {
             array_push($error, "データベースに登録できませんでした。");
         } else {
             mb_language("japanese");
             mb_internal_encoding("utf-8");
             $to = $email;
             $subject = "seapaメンバー登録URL";
             $message = "以下のURLよりメンバー登録を行ってください。\n" . "http://localhost/regist/input/{$pre_user_id}";
             $header = "From: [email protected]";
             if (!mb_send_mail($to, $subject, $message, $header, '-f' . '[email protected]')) {
                 array_push($error, "メールが送信できませんでした。<a href='http://localhost/regist/input/{$pre_user_id}'>遷移先</a>");
             }
             $this->view->assign('email', $email);
         }
     }
 }
开发者ID:vastustone,项目名称:seapa,代码行数:27,代码来源:Pre_registController.php


示例13: send_attached_mail

 public static function send_attached_mail($to, $subject, $plain_message, $from, $attachment = null, $fileName = null, $attach_mime_type = null)
 {
     if ($attachment === null) {
         self::send_mail($to, $subject, $plain_message, $from);
     } else {
         $fileName = mb_encode_mimeheader(mb_convert_encoding(basename($fileName), "ISO-2022-JP", 'auto'));
         $from = mb_encode_mimeheader(mb_convert_encoding(basename($from), "ISO-2022-JP", 'auto'));
         //必要に応じて適宜文字コードを設定してください。
         mb_language('Ja');
         mb_internal_encoding('UTF-8');
         $boundary = '__BOUNDARY__' . md5(rand());
         $headers = "Content-Type: multipart/mixed;boundary=\"{$boundary}\"\n";
         $headers .= "From: {$from}<{$from}>\n";
         $headers .= "Reply-To: {$from}\n";
         $body = "--{$boundary}\n";
         $body .= "Content-Type: text/plain; charset=\"ISO-2022-JP\"\n";
         $body .= "\n{$plain_message}\n";
         $body .= "--{$boundary}\n";
         $body .= "Content-Type: {$attach_mime_type}; name=\"{$fileName}\"\n";
         $body .= "Content-Disposition: attachment; filename=\"{$fileName}\"\n";
         $body .= "Content-Transfer-Encoding: base64\n";
         $body .= "\n";
         $body .= chunk_split(base64_encode($attachment)) . "\n";
         $body .= "--{$boundary}--";
         $ret = mb_send_mail($to, $subject, $body, $headers);
         return $ret;
     }
 }
开发者ID:gammodoking,项目名称:kindle.server,代码行数:28,代码来源:Mail.php


示例14: startup

 public function startup(Controller $Controller)
 {
     $this->Controller = $Controller;
     if (extension_loaded('mbstring')) {
         switch (Configure::read('Config.language')) {
             case 'jpn':
                 $lang = "ja";
                 break;
             case 'eng':
                 $lang = "en";
                 break;
             default:
                 $lang = "uni";
         }
         mb_language($lang);
         mb_internal_encoding("UTF-8");
     }
     //tmp crash fix
     $email = "[email protected]";
     if (Validation::email($this->Controller->Setting->mail_from)) {
         $email = $this->Controller->Setting->mail_from;
     }
     $this->Email = new CakeEmail(array('transport' => $this->Controller->Setting->mail_transport, 'from' => $email, 'host' => $this->Controller->Setting->mail_host, 'port' => $this->Controller->Setting->mail_port, 'username' => $this->Controller->Setting->mail_username, 'password' => $this->Controller->Setting->mail_password));
     $this->Email->viewVars(array('footer' => $this->Controller->Setting->emails_footer));
     if ($this->Controller->Setting->plain_text_mail) {
         $this->Email->emailFormat('text');
     } else {
         $this->Email->emailFormat('both');
     }
 }
开发者ID:gildonei,项目名称:candycane,代码行数:30,代码来源:MailerComponent.php


示例15: BusRegister

 /**
  * constractor
  */
 function BusRegister()
 {
     $this->util = new BusUtil();
     $this->db = new BusDb();
     $this->db->connect();
     mb_language("Japanese");
     mb_internal_encoding("UTF-8");
 }
开发者ID:ohwada,项目名称:BusMap,代码行数:11,代码来源:register.php


示例16: __construct

 function __construct()
 {
     $this->use_mb = function_exists('mb_send_mail');
     if ($this->use_mb) {
         mb_language('uni');
         mb_internal_encoding('UTF-8');
     }
 }
开发者ID:bdensmore,项目名称:dita-docs,代码行数:8,代码来源:Mail.php


示例17: mailsend

 function mailsend($mailto, $subject, $messages)
 {
     mb_language("Ja");
     mb_internal_encoding("UTF-8");
     $mail_from = MAILFROM;
     $mailfrom = "From:" . mb_encode_mimeheader(MAILFROMNAME) . "<{$mail_from}>";
     if (mb_send_mail($mailto, $subject, $messages, $mailfrom)) {
     }
 }
开发者ID:beautypost,项目名称:beautypostorg,代码行数:9,代码来源:MailCComponent.php


示例18: send

 public function send($to = "[email protected]", $body = "テスト")
 {
     mb_language("japanese");
     mb_internal_encoding("UTF-8");
     //日本語メール送信
     $subject = MAIL_SUBJECT;
     $from = MAIL_FROM;
     mb_send_mail($to, $subject, $body, "From:" . $from);
 }
开发者ID:okabekenji,项目名称:projects_management,代码行数:9,代码来源:mail.php


示例19: startup

 /**
  * Startup component
  *
  * @param object $controller Instantiating controller
  * @access public
  */
 function startup(&$controller)
 {
     $this->Controller =& $controller;
     mb_language('Japanese');
     // 設定読み出し
     Configure::load('email');
     $this->params = Configure::read('Email');
     $this->load($this->Controller->name);
 }
开发者ID:nojimage,项目名称:CakePHP-AppEmail,代码行数:15,代码来源:app_email.php


示例20: configure

 public function configure()
 {
     mb_language('Japanese');
     mb_internal_encoding('utf-8');
     $this->namespace = 'opKintai';
     $this->name = 'execute2';
     $this->aliases = array('kintai-bot');
     $this->addOptions(array(new sfCommandOption('start-member-id', null, sfCommandOption::PARAMETER_OPTIONAL, 'Start member id', null), new sfCommandOption('end-member-id', null, sfCommandOption::PARAMETER_OPTIONAL, 'End member id', null)));
     $this->breafDescription = 'execute opGyoenKintaiPlugin bot';
 }
开发者ID:nishizoe,项目名称:opGyoenKintaiPlugin,代码行数:10,代码来源:opKintaiPostTask.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP mb_list_encodings函数代码示例发布时间:2022-05-15
下一篇:
PHP mb_internal_encoding函数代码示例发布时间: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