require_once('class_B.php');
class A
{
     function runB()
     {
        B::func();
     }
}

解决方案 »

  1.   

    可是我死活得不到B类函数的返回值,郁闷require_once('class_B.php');
    class A
    {
         function runB()
         {
            $tt = B::func();
         }
    }但是那个返回值死活得不到
      

  2.   

    require_once('class_B.php');
    class A
    {
         var $tt;
         function runB()
         {
            $this->tt = B::func();
         }
    }$a = new A();
    $a->runB();
    echo $a->tt;
      

  3.   

    require_once('class_B.php');
    class A
    {
         function runB()
         {
            $tt = B::func();
         }
    }这样,B类中func()只能是一个静态方法
      

  4.   

    没有说清楚,其实已经是这样了
    require_once('class_B.php');
    class A
    {
         var $xx = array();
         function runB()
         {
             $tt = B::func();
             $this->xx[a] = $tt[a];
             $this->xx[b] = $tt[b];
         }
    }$this->xx[a]和$this->xx[a]在A类另外一个函数中将其值插入数据库,可是一直没有值。还得请教高手再指点一下,多谢
      

  5.   

    require_once('class_B.php');
    class A
    {
         var $xx = array();
         function runB()
         {
       $bObj = new B();
             $tt = $bObj->func();
             $this->xx[a] = $tt[a];
             $this->xx[b] = $tt[b];
         }
     
     function inserSql()
     {
      $this->runB();
    /****
    deal with $this->xx
    ****/
     }
     
    }