1,在函数中,传递数组时 使用 return 比使用 global 要高效,比如 以下是PHP代码:【复制】 function userloginfo($usertemp){ $detail=explode("|",$usertemp); return $detail; } $login=userloginfo($userdb); 比 function userloginfo($usertemp){ global $detail; $detail=explode("|",$usertemp); } userloginfo($userdb); 要高效 2,(这个代码用于得到程序目录对应的网址,推荐使用) $urlarray=explode('/',$HTTP_SERVER_VARS['REQUEST_URI']); $urlcount=count($urlarray);unset($urlarray[$urlcount-1]); $ofstarurl='http://'.$HTTP_SERVER_VARS['HTTP_HOST'].impl...
外部JavaScript文件块下载和伤害你的页面的性能,但有一个简单的方法来解决此问题:并行使用动态脚本标记和加载脚本,提高页面加载速度和用户体验。 --The problem: scripts block downloadsLet's first take a look at what the problem is with the script downloads. The thing is that before fully downloading and parsing a script, the browser can't tell what's in it. It may contain document.write() calls which modify the DOM tree or it may even contain location.href and send the user to a whole new page. If that happens, any components downloaded from the previous page may never be needed. In order ...