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

PHP set_charset函数代码示例

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

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



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

示例1: connect

 /**
  * Connect to the database.
  * Note: Currently only MariaDB supported.
  * 
  * @global mysqli
  * @param type $vendor
  * @param type $host
  * @param type $user
  * @param type $password
  * @param type $dbname
  * @return boolean
  */
 public function connect($vendor, $host, $user, $password, $dbname)
 {
     if ($vendor == $this->MARIADB) {
         $this->db = new mysqli($host, $user, $password, $dbname);
         if ($this->db->connect_errno) {
             return $this->db->connect_errno;
         }
     }
     if (!$this->db - set_charset("utf8")) {
         return $this->db->error;
     }
     return null;
 }
开发者ID:lhaselauer,项目名称:churchtools_basic,代码行数:25,代码来源:dbsync.php


示例2: set_charset

<?php

include_once '../frame.php';
$user = User::current_user();
set_charset("utf-8");
if (!$user) {
    alert("请您先登录!");
    ?>
		<script>window.location.href="/login/";</script>
		<?php 
}
$resos_id = $_POST["resos_id"];
if (!is_numeric($resos_id)) {
    die('invlid request!');
}
$db = get_db();
$db->execute("delete from eachbb_member.comment where resource_id={$resos_id} and resource_type='photo'");
$resutl = $db->query("SELECT photo,album_id FROM  eachbb_member.photo p where id={$resos_id};");
$result = $resutl[0]->photo;
$resource_id = $resutl[0]->album_id;
#echo $result;
#var_dump("../"substr($result,1));
if (!$db->execute("delete from eachbb_member.photo where id=" . $resos_id)) {
    die("删除失败!");
} else {
    $db->execute("insert into `eachbb_member`.lastest_news (resource_id,resource_type,u_id,created_at,u_name,u_avatar,form)values('{$resource_id}','image','{$user->id}',now(),'{$user->name}','{$user->avatar}','删除了一张照片:')");
    echo "删除成功!";
}
if (is_file(".." . $result)) {
    @unlink(".." . $result);
} else {
开发者ID:justin1986,项目名称:eachbb,代码行数:31,代码来源:_photo_show_delete_ajax_post.php


示例3: intval

<?php

include_once '../frame.php';
include_once '../inc/user.class.php';
$news_id = intval($_POST['news_id']);
$news = new table_class('eb_category');
$news->find($news_id);
if (!$news->id) {
    die('invalid param');
}
$len = count($_POST['mail']);
set_charset();
$news_share = new table_class('eb_news_share');
$user = User::current_user();
echo $user->password;
if (!$user) {
    die('need login');
}
for ($i = 0; $i < $len; $i++) {
    if (empty($_POST['mail'][$i])) {
        continue;
    }
    if (!check_email($_POST['mail'][$i])) {
        die($_POST['mail'][$i] . " 格式不正确");
    }
    $news_share->id = 0;
    $news_share->user = $user->name;
    $news_share->nick_name = htmlspecialchars($_POST['name'][$i]);
    $news_share->email = htmlspecialchars($_POST['mail'][$i]);
    $news_share->created_at = now();
    $news_share->news_id = $news_id;
开发者ID:justin1986,项目名称:eachbb,代码行数:31,代码来源:share.post.php


示例4: set_charset

if (!is_numeric($svg_scalingfactor)) {
    $svg_scalingfactor = 1.0;
}
if (!is_numeric($svg_scalingfactor_rxn)) {
    $svg_scalingfactor_rxn = 0.75;
}
if (strpos($mol2svgopt, '--scaling=') === FALSE) {
    $mol2svgopt .= " --scaling={$svg_scalingfactor}";
}
if (strpos($mol2svgopt_rxn, '--scaling=') === FALSE) {
    $mol2svgopt_rxn .= " --scaling={$svg_scalingfactor_rxn}";
}
if (config_quickcheck() > 0) {
    die;
}
set_charset($charset);
if (!isset($sitename) || $sitename == "") {
    $sitename = "Sristi Biosciences";
}
@($db_id = $_REQUEST['db']);
@($datatype = $_REQUEST['datatype']);
@($action = $_REQUEST['action']);
@($smiles = $_POST['smiles']);
@($jme = $_POST['jme']);
@($mol = $_POST['mol']);
@($clrmaps = $_POST['clr']);
$ostype = getostype();
// new in Jan 2014 edition: choice of structure editors
@($curr_settings = $_COOKIE["MolDB6"]);
$curr_a = explode(",", $curr_settings);
foreach ($curr_a as $curr_line) {
开发者ID:Procxl,项目名称:libraries,代码行数:31,代码来源:editdata.php


示例5: get_db

<?php

include_once '../frame.php';
$photo = $_POST["photo"];
$db = get_db();
set_charset("UTF-8");
$user = User::current_user();
if (!$user) {
    die("请先登录!");
}
if (!$photo) {
    die("非法操作!");
}
$sql = "insert into eachbb_member.album(u_id,name,created_at,last_update_time,visit_count,comment_count)values('{$user->id}','{$photo}',now(),now(),0,0);";
$resource_id = "select id from eachbb_member.album where u_id = '{$user->id}' order by created_at desc limit 1";
$resource_id = $resource_id[0]->id;
echo $resource_id;
if ($db->execute($sql)) {
    if ($db->execute("insert into `eachbb_member`.lastest_news (resource_id,resource_type,u_id,created_at,u_name,u_avatar,form,photo)values('{$resource_id}','image','{$user->id}',now(),'{$user->name}','{$user->avatar}','添加了新相册:','{$photo}')")) {
        echo "添加相册成功!";
    }
} else {
    echo "添加相册失败!";
}
开发者ID:justin1986,项目名称:eachbb,代码行数:24,代码来源:_upload_photo_ajax_post.php


示例6: dirname

<?php

include_once dirname(__FILE__) . './../frame.php';
set_charset('utf-8');
js_include_tag('swfobject', 'public_top');
use_jquery_ui();
?>
<style>
#top_login{
	width:970px;
	height:103px;
}
#tl_l{
	width:227px;
	background:url('/images/top/logo.png') no-repeat;
	float:left;
}
#tl_r{
	width:702px; 
	height:103px;
	background:none;
	float:right;
	display:inline;
}
#tl_r_l{
	width:22px;
	height:82px;
	background:url('/images/top/t_l.jpg') no-repeat;
	float:left;
}
#tl_r_r{
开发者ID:justin1986,项目名称:eachbb,代码行数:31,代码来源:_public_top.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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