易截截图软件、单文件、免安装、纯绿色、仅160KB

用php对json字符串编码问题

    昨天调用同事的一个json接口,发现调用php中的函数json_decode无法转化为数组。
   <?php
$json = "{'d':[['xxx','中国','广西','xjr7670@sina.com','2010-05-01 13:35:02'],['xxx','中国','广西','xjr7670@sina.com','2010-05-01 13:35:02']],'c':13659,'n':759}";
print_r(json_decode($json, true));//无法显示
//将单引号改为双引号就好了
$json = '{"d":[["xxx","中国","广西","xjr7670@sina.com","2010-05-01 13:35:02"],["xxx","中国","广西","xjr7670@sina.com","2010-05-01 13:35:02"]],"c":13659,"n":759}';
print_r(json_decode($json, true));


相关文档:

利用ip地址查询区域 php程序

该程序没有优化 只是最原始的程序  可以将其与flash结合起来!
与flash结合起来就是将php得到的地址和区域 打印出来再返回个flash端这么简单
<?php
$getIP="218.11.140.23"; // 这里是自己随便写的一个ip  实际时你还要通过程序得到这个ip
//只开始时查前三段
$subIPs=explode(".",$getIP);
$subIP=$sub ......

PHP Floating point precision

Floating point precision
It is typical that simple decimal fractions like 0.1
or
0.7
cannot be converted into their internal binary
counterparts without a small loss of precision. This can lead to
confusing
results: for example, floor((0.1+0.7)*10)
will usually
return 7
......

php获取原图片

<?php
/*
获取远程图片函数
*/
function GrabImage($url,$filename=""){
//若url为空返回false,无地址
if($url=="") return false;
//若$filename为空
if($filename=="") {
$ext=strrchr($url,"."); //获取"."加后缀
if($ext!=&qu ......

PHP进度条效果

用PHP实现进度条效果。
<?php
set_time_limit(0);
echo '<h2>正在安装,请稍后...</h2>',
'<div style="border:1px solid #000;width:500px;"><div id="progress_bar">loading...</div></div>';
for($i=1;$i<=100;$i++){
$width = '500';
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号