Mon Oct 27, 2008 12:13 am
<?php
class A {
function getA( ) {
return array( "A", "B" );
}
function setA( $country, $district ) {
return "$country, $district\n";
}
}
class Helper {
private $classA;
function __construct( A $classA ) {
$this->classA = $classA;
}
function __call( $method, $args ) {
if ( method_exists( $this->classA, $method ) ) {
return call_user_func_array(array( $this->classA, $method ), $args );
}
}
}
$tool= new Helper( new A() );
print_r( $tool->setA( 'UK', 'BN' ) );
?>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.