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

学习php Reflection(二)

(4)映射类(ReflectionClass)
ReflectionClass类允许你反向映射类。
<?
php
interface MySerializable  
{    
// ...}
class My
Object
 
{    
// ...}
/** A counter class */
class 
Counter 
extends
MyObject implements MySerializable 
{   const 
START 

0
;
    
private 
static 
$c 

Counter
::
START
;
    
/**Invoke counter
     * @access  public
     * @return  int */
    
public 
function 
count
() {  return 
self
::
$c
++;  }
}
// Create an instance of the ReflectionClass class
$class 
= new 
ReflectionClass
(
'Counter'
);
// Print out basic information
printf
(
"===> The %s%s%s %s '%s' [extends %s]\n" 
.
    
"     declared in %s\n" 
.
    
"     lines %d to %d\n" 
.
    
"     having the modifiers %d [%s]\n"
,
        
$class
->
isInternal
() ? 
'internal' 

'user-defined'
,
        
$class
->
isAbstract
() ? 
' abstract' 

''
,
        
$class
->
isFinal
() ? 
' final' 

''
,
        
$class
->
isInterface
() ? 
'interface' 

'


相关文档:

在PHP中遍历数组元素

原文链接:http://www.phpdo.net/index.php/20100411/56.html
在PHP中使用foreach函数可以遍历数组。Foreach仅能用于数组,语法如下:
 Foreach(array as $value) statements
 Foreach(array as $key=>$value) statement
第一种语法遍历数组时,每次循环时,当前单元的值被赋给$value,数组内部的指针向前 ......

PayPal PHP接口 paypal在线支付


再次之前先说一个网址:https://www.paypaltech.com/SG2/
            这个是生成paypal IPN的网址,这样说吧,是替你生成代码的网址(非常的好)!不懂没关系!先知道一下! 
下载教程网址:http://download.csdn.net/source/2225766
http://download.cs ......

[转]PHP获取IP地址

[转自]http://hi.baidu.com/xiamishule/blog/item/dea92c09ef9acc9e0b7b8236.html
源代码:
PHP获取IP的方法有许多种,<br />今天向大家总结了六种方法。
<br />PHP获取IP方法一:
<?php    
function GetIP() {
    if(!empty($_SERVER["HTTP_CLIENT_ ......

学习php Reflection(一)

看yii框架源码的时候,发现了
ReflectionClass这个方法,才发现原来是php5的新东西,于是稍微研究了下。php的反射api一共有:
class 
Reflection 
{ }
interface Reflector 
{ }
class 
ReflectionException 
extends 
Exception 
{ }
class 
Re ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号