平时细节(php)

本篇文章用来记录平时的一些细节问题,随时更新……

1.<a href="tencent://message/?uin=446473669">dd</a> 此链接可以调用本地QQ聊天程序uin后面就是所要聊天的对象

2.用get传值为汉字时,在谷歌浏览器下不会出现乱码,而在ie浏览器下则会出现,把所要传的值用urlencode()函数编码下则在ie浏览器地址栏中显示的是编码后的值,而在谷歌浏览器地址栏则依旧显示的是汉字

<a href="t.php?id=<?php echo urlencode("你好");?>">test</a>

3.页面输出时的格式控制nl2br(htmlspecialchars(“string”))

4.

<?php 
print_r($_POST['arr']).'<br>';
echo $_POST['arr'][0];
?>
<form method="post" action="">
<input type="text" name="arr[]"/>
<input type="text" name="arr[]"/>
<input type="text" name="arr[]" />
<input type="submit"  />
</form> 
5.count() 括号里只能是* 或者是单个字段,多个字段不能

6.PHP strstr() 函数

string strstr ( string $haystack , mixed $needle [, bool $before_needle = false ] )
Returns part of haystack string starting from and including the first occurrence of needle to the end of haystack.
Note:
This function is case-sensitive. For case-insensitive searches, use stristr().(大小写敏感)
Note:
If you only want to determine if a particular needle occurs within haystack, use the faster and less memory intensive function strpos() instead.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值