Jump to content

variable for class name and method


doddsey_65

Recommended Posts

<?php  

class myClass {
static function printWords( $w1, $w2 ) {
	echo $w1.' '.$w2;
}
}

$name = 'myClass';

call_user_func_array( array($name,'printWords'), array('hello','world') );

?>

 

http://php.net/manual/en/function.call-user-func-array.php

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.