string strip_tags ( string str [, string allowable_tags] )
弊端 :
string strip_tags ( string str [, string allowable_tags] )
弊端 :
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = ‘config’;
$cfg['Servers'][$i]['user'] = ‘root’;
$cfg['Servers'][$i]['password'] = ”;
$cfg['Servers'][$i]['port'] = ’3307′;
$cfg['Servers'][$i]['extension'] = ‘mysql’;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = ”;
一,如果php没有限制我们可以在上传时就限制上传大小,如
删除数组指定元素
<?php
$a=array(0=>"Dog",1=>"Cat",2=>"Horse",3=>"Bird");
print_r(array_slice($a,1,2));
?>
is_array — 检测变量是否是数组
Report a bug 描述
bool is_array ( mixed $var )
生成html原理分析
我们把要生成的标签写成一个模板文件,然后再利用php读取把指定标签替换成我们要替换 内容就可以了,现在主流的dedecms系统也是这么做的
首先来说说buffer,它是一个内存地址空间,为4096(1kb)【在php.ini配置文件中找到output_buffering配 置】,php有php output_buffering机制,php代码在执行的时候,并不是立即将内容输出,而是想将echo/print内容输出到buffer,buffer满的时候才会将数据交给系统内核交由tcp传给浏览器显示,当开启php php output_buffering机制(默认是开启的,可以通过ob_start()函数开启)后,只有当php buffer中的数据达到了设置值,才会将buffer中 的数据发送给浏览器。但是浏览器也是有缓存的,一些版本的浏览当数据达到256字节的时候才输出内容,
ob_start()函数:打开输出缓冲区.
函数格式 void ob_start(void)
说明:当缓冲区激活时,所有来自PHP程序的非文件头信息均不会发送,而是保存在内部缓冲区。为了输出缓冲区的内容,可以使用ob_end_flush()或flush()输出缓冲区的内容。
phpMyAdmin配置文件在libraries下的config.default.php中,主要配置如下:
一般的话,如果你的mysql和phpmyadmin放在同一服务器上,主机名就直接用localhost
Codigniter框架使用jquery+ajax/" target="_blank">jquery ajax代码如下:
<form action="<?php echo @htmlspecialchars($url['login_url']) ?>" method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1">
<p><label>工资号:</label>
<input name="Login.Token1" class="text" type="text" id="token1" />
</p>
<p><label>密 码:</label>
<input name="Login.Token2" class="text" type="password" id="token2" />
</p>
<p>
<input name="登录" type="submit" id="user_login" value="登录" />
<input type="reset" value="重置" />
</p>
<b style="color:red"><?php echo $this->session->flashdata('error'); ?></b>
</form>
<script>
$(function(){
$("#user_login").click(function(){
var username = $("#token1").val();
var salary_no = $("#token2").val();
$.ajax({
type: "POST",
data: "username="+username+"&salary_no="+salary_no,
url: "<?php echo site_url('http://pic4.phprm.com/2013/05/07/ajax_check_username.jpg')?>",
dataType: "text",
cache: false,
error: function(){alert('error');},
success: function(data){
if(data == 'yes'){
location.href="<?php echo site_url('http://pic4.phprm.com/2013/05/07/index.jpg')?>";
}else{
form1.submit();
}
}
});
return false;
});
});
</script>
需要判断两个数组是否有交集,第一个感觉PHP中应该有这个函数,果然:
array array_intersect(array array1,array array2[,arrayN…])
URI 是 Web上可用的每种资源 - HTML文档、图像、视频片段、程序等 - 由一个通用资源标志符(Uniform Resource Identifier, 简称"URI")进行定位。
对就分组:
PHPExcel是相当强大的 MS Office Excel 文档生成类库,当需要输出比较复杂格式数据的时候,PHPExcel 是个不错的选择。不过其使用方法相对来说也就有些繁琐