Jump to content

php Class error


GD77

Recommended Posts

 

 

$yyy;

$metaDesc;

$tst1="fkr";

class pg {

  public function yeh() {

    global $tst1;

    echo $tst1;

    }

 

  public function pg_Index(){

    echo "tst3";

    }

    public function pg_Company(){

    echo "tst4";

    }

 

}

//$mD_0=pg::pg_Index();

//$mD_1=pg::pg_Company();

$mD_5=pg::pg_Register();

 

if($yyy=='xxx'){$metaDesc=pg::yeh();}

if($yyyy=='xxx'){$metaDesc=$mD_1;}

if($yyy=='xxx'){$metaDesc="Registration Page";}

 

print_r ("<meta name='description' content='".$metaDesc."' />");

 

////////////////////////////////////////////////

why the object of the class being echoed to the page by default? o.O

why can't get the data from the object into the final $metaDesc?

 

Link to comment
https://forums.phpfreaks.com/topic/265277-php-class-error/
Share on other sites

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.