Vivian Steller wrote:
...
> class MyClass {
>    function __call($method, $params) {
>       // $params = Array(mixed var, mixed var, ...);
>       print("request for " . $method . "()\n");
>                         
>       // how to get objects in this string?!
>       // do i have to implement "switch($type) { case
>       $parameterstring = "\"" . $params[0] . "\"";
>       eval("OtherClass::" . $method .
>                         "(" . $parameterstring . ");");
>                 
>    }
> }
...

ok, i'm sorry, but i found the solution for my own:

on the top you see some snippet of my EXAMPLE Message before.

you can implement the $parameterstring generation algorithm like this (and
its very very easy!!)


   $parameterstring = "";
   for($i = 0; $i < count($params); $i++) {
      if(!empty($parameterstring)) {
         $parameterstring .= ", ";
      }
                                
      $parameterstring .= "\$params[" . $i . "]";
   }

replace the line "$parameterstring = "\"" . $params[0] . "\"";" with this
code snippet and it works...

any way, thanks.

vivi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to