2017年7月5日

PHP对象3: public / private / protected

摘要: '; } public function wsay(){ $this->say(); } } class B extends A { public function Bsay($input){ $this->name = $input; echo 'Say name\'s:'.$this->name.''; ... 阅读全文

posted @ 2017-07-05 22:23 Perl6 阅读(233) 评论(0) 推荐(0) 编辑

PHP对象2: 构造函数与析构函数

摘要: 当一个对象的所有引用都没有时, 一个对象才消失, 这时才执行析构函数 阅读全文

posted @ 2017-07-05 06:18 Perl6 阅读(224) 评论(0) 推荐(0) 编辑

PHP对象1: 创建对象与 $this

摘要: '; $this->name = "传入的值是:{$name}"; echo $this->name.''; } } $one = new perl('a'); #创建对象时返回对像的引用 #$one->name = 'perl6'; #对像之前的赋值, 是址址传递 #比如: $two = $one; #这样的话, 这两个对像是一样的, 内存地址一样,... 阅读全文

posted @ 2017-07-05 03:33 Perl6 阅读(444) 评论(0) 推荐(0) 编辑

PHP提取url

摘要: <?php $str = parse_url('http://localhost/?id=2&cd=2', PHP_URL_QUERY); ECHO $str; parse_str($str, $cc); print_r($cc); 阅读全文

posted @ 2017-07-05 01:45 Perl6 阅读(280) 评论(0) 推荐(0) 编辑

PHP中的 get_magic_quotes_runtime

摘要: get_magic_quotes_runtime() 获得外部文件及数据库资料时是否进行转义 set_magic_quotes_runtime(1); 临时设置获得外部文件及数据库资料时是否进行转义 比如读取数据库资料或从外部读取文件时, 会进行转义(如果开启) eg: select username from admin; result: admin\'... 阅读全文

posted @ 2017-07-05 00:48 Perl6 阅读(322) 评论(0) 推荐(0) 编辑

php中的转义函数

摘要: <?php parse_url 解析URL, 返回各组成部分 urlencode/urldecode url编码/解码 htmlentities 将字符串转化为html实体 htmlentities($str, $key) $key: ENT_COMPAT 只转换双引号, 默认 ENT_QUOTES 转换单双引号 ENT_NOQU... 阅读全文

posted @ 2017-07-05 00:31 Perl6 阅读(345) 评论(0) 推荐(0) 编辑

导航