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

php中判断自定义方法是否存在

<?php
 
 
  function myFun(){
   echo "hello,张三";
  }
 
  //利用function_exists方法判断自动以方法是否存在
  //该方法参数为要判断的自定义方法的方法名,可写为
  //"myFun"或myFun
  if(function_exists(myFun)){
   echo "存在";
  }else{
   echo "不存在";
  }
?>


相关文档:

php正则取嵌套html标签

<?php
$s = <<<html
<html>
<head>
<title>nested tag test</title>
<mce:script type="text/javascript"><!--
alert('fdsafdasfasd');
// --></mce:script>
</head>
<body>
<div id=0>
<div id=1><img name="im ......

Berkeley 5.0.21提供的PHP扩展的Bug

今天装了个Berkeley 5.0.21进行测试。
顺利编译了自带的php_db4模块后,进行测试。发现del操作报错:
illegal flag specified to DB->del
<?php
dl('db4.so');
$db = new Db4();
$db->open(null, 'info.db', 'info');
$db->put('key', 'value');
var_dump($db->del('key'));
$db->close();
$db ......

BDB官方给PHP提供的接口的程序员真是不负责

刚写完前面的日志,又发现一个Bug:
根据Oracle官方提供的说明:
http://www.oracle.com/technology/documentation/berkeley-db/db/programmer_reference/ext_php.html
class Db4的声明如下:
class Db4 {
function Db4($dbenv = null) {} // create a new Db4 object using
......

防范php木马

1、防止跳出web目录 (严重采用)
  首先修改httpd.conf,如果你只允许你的php脚本程序在web目录里操作,还可以修改httpd.conf文件限制php的操作路径。比如你的web目录是/usr/local/apache/htdocs,那么在httpd.conf里加上这么几行:
  php_admin_value open_basedir /usr/local/apache/htdocs
  这样,如果脚本要 ......

php 架构和模式

1 代理(Proxy)和委派(Delegate)的区别
http://hi.baidu.com/thinkinginlamp/blog/item/2297a7efcb52a31afdfa3cc2.html
2 开心农场架构介绍
http://www.javaeye.com/wiki/facebook/1766-five-minutes-happy-farm-structure-introduced
http://www.w2blog.net/view/455.html
3 SmugMug 的架构介绍
http://www.w2blo ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号