字符串的第几个字母

我们可以使用 $str{3} 的形式来取得字符串 $str 的第三位字母…  听说在php6中将被取消
·不再支持用于字符串索引的{}注释,而[]版本将被添加到substr()和array_slice()功能中。以前的[]为许多人所批评,但是大多数的开发者,包括我在内,都一直使用[]。

选项卡效果

阿里88的一段代码[精品]

代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <style type="text/css"> <!-- * { margin: 0; padding:0 } body { margin-top: 10px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; height: auto; width: auto; background-color: #666666; font-size: 12px; color: #000000; } #container { text-align: left; width: 760px; height: 400px; background-color: #FFFFFF; padding: 20px; } #container #title { height: 28px; } #container #title li { float: left; list-style-type: none; height: 28px; line-height: 28px; text-align: center; margin-right: 1px; } #container #title ul { background-color: #FFFFFF; height: 28px; } #container #title a { text-decoration: none; color: #000000; display: block; width: auto; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_left_bk2.gif) no-repeat left -29px; } #container #title a span{ display: block; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_right_bk2.gif) no-repeat right -29px; padding: 0 15px 0 15px; } #container #title #tag1 a:hover { text-decoration: none; color: #ffffff; display: block; width: auto; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_left_bk2.gif) no-repeat left -87px; } #container #title #tag1 a:hover span{ display: block; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_right_bk2.gif) no-repeat right -87px; padding: 0 15px 0 15px; } #container #title #tag2 a:hover { text-decoration: none; color: #ffffff; display: block; width: auto; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_left_bk2.gif) no-repeat left 0px; } #container #title #tag2 a:hover span{ display: block; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_right_bk2.gif) no-repeat right 0px; padding: 0 15px 0 15px; } #container #title #tag3 a:hover { text-decoration: none; color: #ffffff; display: block; width: auto; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_left_bk2.gif) no-repeat left -58px; } #container #title #tag3 a:hover span{ display: block; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_right_bk2.gif) no-repeat right -58px; padding: 0 15px 0 15px; } #container #title #tag4 a:hover { text-decoration: none; color: #ffffff; display: block; width: auto; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_left_bk2.gif) no-repeat left -145px; } #container #title #tag4 a:hover span{ display: block; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_right_bk2.gif) no-repeat right -145px; padding: 0 15px 0 15px; } #container #title #tag5 a:hover { text-decoration: none; color: #ffffff; display: block; width: auto; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_left_bk2.gif) no-repeat left -174px; } #container #title #tag5 a:hover span{ display: block; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_right_bk2.gif) no-repeat right -174px; padding: 0 15px 0 15px; } #container #title .selectli1 { text-decoration: none; color: #ffffff; display: block; width: auto; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_left_bk2.gif) no-repeat left -87px; } #container #title a .selectspan1 { display: block; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_right_bk2.gif) no-repeat right -87px; padding: 0 15px 0 15px; } #container #title .selectli2 { text-decoration: none; color: #ffffff; display: block; width: auto; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_left_bk2.gif) no-repeat left 0px; } #container #title a .selectspan2 { display: block; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_right_bk2.gif) no-repeat right 0px; padding: 0 15px 0 15px; } #container #title .selectli3 { text-decoration: none; color: #ffffff; display: block; width: auto; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_left_bk2.gif) no-repeat left -58px; } #container #title a .selectspan3 { display: block; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_right_bk2.gif) no-repeat right -58px; padding: 0 15px 0 15px; } #container #title .selectli4 { text-decoration: none; color: #ffffff; display: block; width: auto; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_left_bk2.gif) no-repeat left -145px; } #container #title a .selectspan4 { display: block; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_right_bk2.gif) no-repeat right -145px; padding: 0 15px 0 15px; } #container #title .selectli5 { text-decoration: none; color: #ffffff; display: block; width: auto; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_left_bk2.gif) no-repeat left -174px; } #container #title a .selectspan5 { display: block; background: url(http://pics.taobao.com/2k5/sys/component/tab_selected_right_bk2.gif) no-repeat right -174px; padding: 0 15px 0 15px; } #container #content ul {margin: 10px;} #container #content li {margin: 5px; } #container #content li img {margin: 5px;display:block;} #container #content { height: 300px; padding: 10px; } .content1 { border-top-width: 3px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #3A81C8; border-right-color: #3A81C8; border-bottom-color: #3A81C8; border-left-color: #3A81C8; background-color: #DFEBF7; } .content2 { border-top-width: 3px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #ff950b; border-right-color: #ff950b; border-bottom-color: #ff950b; border-left-color: #ff950b; background-color: #FFECD2; } .content3 { height: 300px; padding: 10px; border-top-width: 3px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #FE74B8; border-right-color: #FE74B8; border-bottom-color: #FE74B8; border-left-color: #FE74B8; background-color: #FFECF5; } .content4 { height: 300px; padding: 10px; border-top-width: 3px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #00988B; border-right-color: #00988B; border-bottom-color: #00988B; border-left-color: #00988B; background-color: #E8FFFD; } .content5 { height: 300px; padding: 10px; border-top-width: 3px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #A8BC1F; border-right-color: #A8BC1F; border-bottom-color: #A8BC1F; border-left-color: #A8BC1F; background-color: #F7FAE2; } .hidecontent {display:none;} --> </style> <script language="javascript"> function switchTag(tag,content) { // alert(tag); // alert(content); for(i=1; i <6; i++) { if ("tag"+i==tag) { document.getElementById(tag).getElementsByTagName("a")[0].className="selectli"+i; document.getElementById(tag).getElementsByTagName("a")[0].getElementsByTagName("span")[0].className="selectspan"+i; }else{ document.getElementById("tag"+i).getElementsByTagName("a")[0].className=""; document.getElementById("tag"+i).getElementsByTagName("a")[0].getElementsByTagName("span")[0].className=""; } if ("content"+i==content) { document.getElementById(content).className=""; }else{ document.getElementById("content"+i).className="hidecontent"; } document.getElementById("content").className=content; } } </script> </head> <body> <div id="container"> <div id="title"> <ul> <li id="tag1"><a href="#" onclick="switchTag('tag1','content1');this.blur();" class="selectli1"><span class="selectspan1">首页</span></a></li> <li id="tag2"><a href="#" onclick="switchTag('tag2','content2');this.blur();"><span>下载中心</span></a></li> <li id="tag3"><a href="#" onclick="switchTag('tag3','content3');this.blur();"><span>产品介绍</span></a></li> <li id="tag4"><a href="#" onclick="switchTag('tag4','content4');this.blur();"><span>会员注册与登录</span></a></li> <li id="tag5"><a href="#" onclick="switchTag('tag5','content5');this.blur();"><span>联系我们</span></a></li> </ul> </div> <div id="content" class="content1"> <div id="content1"><p>仿淘宝网站的导航效果。此方法有几个优点:</p>1、根据字数自适应项目长度</div> <div id="content2" class="hidecontent">2、不同的项目使用不同的颜色来区分</div> <div id="content3" class="hidecontent">3、这回需要使用到js了,呵呵</div> <div id="content4" class="hidecontent">4、背景图片只需要两个图片文件就足够,减少服务器负担</div> <div id="content5" class="hidecontent">5、这是使用到的两个图片: <table width="58%" border="1" cellspacing="2" cellpadding="0"> <tr> <td width="70%" align="center"><img src="http://pics.taobao.com/2k5/sys/component/tab_selected_left_bk2.gif" width="250" height="290" /></td> <td width="30%" align="center"><img src="http://pics.taobao.com/2k5/sys/component/tab_selected_right_bk2.gif" width="15" height="290" /></td> </tr> </table> </div> </div> </div> </body> </html>

当ajax遭遇系统错误: -1072896658

如果XMLHttpRequest对象请求的文档未指定正确的utf-8编码,就会出现这个错误
浏览器系统错误:-1072896658(Explorer system error: -1072896658)

PHP:

1.
header(‘text/javascript; charset=utf-8’);

http://www.panoramio.com/blog/explorer-system-error-1072896658/

Don’t you love when explorer express its griefs in such a clear and helpful way?

A was putting the last touches to the new "Search place" code, and it
was working beautifully in Firefox and in Explorer, when I faced a
problem in Safari. The query to the database that retrieves the name
of places that match the user search came back with the accents
garbled!

Safari thought the received page, that I was retrieving with
XMLHttpRequest behind the scenes, was encoded in ISO-8859-1 (or most
probably, -15) when I was serving it in UTF-8.

Fair enough, I just have to put the header "Content-Type: text/plain;
charset=utf8″ in the reply, and sure enough, Safari was now working
like a charm.

But then, the search stopped working at all in Internet Explorer! I
was getting a weird error in the status bar:

Explorer system error: -1072896658

This thing popped when I tried to access the responseText of the
request object. After I googled a bit this error code, I found that it
was due to the XMLHttpRequest control receiving a reply on an unknown
encoding. Please guys, next time put a message like:

XMLHttpRequest requested document was in the unknown "utf8″ encoding.
See the list of accepted encodings.

It turns out the charset should be UTF-8, and not utf8. Fixed it, and
now it is happily working on these 3 browsers.

Update: Attentive reader Johan Sundström pointed out that I was
missing the "text/plain; charset=" part on the Content-Type. I should
really double check my blog entries before posting them.

This entry was posted on Sunday, October 30th, 2005 at 10:59 pm and is
filed under Uncategorized. You can follow any responses to this entry
through the RSS 2.0 feed. You can leave a response, or trackback from
your own site.
6 Responses to "Explorer system error: -1072896658"

1. Johan Sundström Says:
November 2nd, 2005 at 11:10 am

Shouldn’t that rather be Content-Type: text/plain; charset=UTF-8
(or perhaps text/javascript, depending on the content payload)?
2. Joaquín Cuenca Abela Says:
November 2nd, 2005 at 11:32 am

Hi Johan,

yes, it should be Content-Type: text/plain; charset=UTF-8, thank
you for the catch! I wrote this entry in a hurry and I missed it
completely.

Regards,

FICLASS的修正BUG

guest[2006-03-28 01:03:40]

fclass1.1有个很大的BUG 就是其中一个人修改了密码或注册之后,密码全部都变一样了,应该是忘了加判断了 PS:这个程序不错:)

回复:

非常感谢你。确实少了个判断 修改方法是:打开viewpro.php 找到$sql="update ".$db_prefix."user set password=’".md5($new_psword)."’ " 这句,修改为 $sql="update ".$db_prefix."user set password=’".md5($new_psword)."’ where userid=’".$editid."’";
发布FICLASS1.1.1   http://www.flyy.info/ficlass1.1.1.rar

十大不靠谱投资

星期五,放轻松。说点不靠谱的事,但都是我这些年看到的。

1.        因为员工要吃饭而投资开了餐馆。(员工联系业务还要打电话呢您不考虑买点中国移动的股票?)

2.        因为找了个漂亮的女朋友而投资拍了电影。(你问你女朋友,她肯定更愿意你把那本来也是打水漂的钱直接打到她的账户上。)

3.        因为有块地而干上了房地产,因为干了房地产又投资办起了贵族学校。(中国最邪门的事就是谁都觉得自己可以干房地产,房地产公司又总觉得自己什么都可以干。)

4.        为了降低原材料成本而收购自己的原材料供应商。(可是原材料供应商还有它们的原材料供应商呢,要不您直接来两块森林外带一铁矿或者油田?)

5.        为了降低销售成本而收购了自己的分销商。(也就是咱国家不允许投资税务局,要不然真会有企业打这主意!)

6.        因为爱打高尔夫尔投资了高尔夫球场。(您最好每天能打54个洞这样起码从健身的角度还是划算的。)

7.        因为钱柜老定不上房而投资了卡拉OK。(投了以后没准还照样去钱柜排队。)

8.        投资任何这个“系”那个“系”的A股上市公司。(有“系”了就神秘,神秘了就没戏。)

9.        因为别人告诉您这是一个稳赚不赔没有风险的项目而投了资。(如同男人说“你是我见过的最美的女孩儿”,有些话当段子听还能找点乐子。)

10.    以为自己能够改变对方而继续一段明知道没有结果的恋情。(Nike的广告语怎么说的来着人生苦短,山外有山这后半句是我编的哈!)