Some Questions

Hi:

I have a question on calling a method in PHP.

suppose I have file class1.php which contains class1
<?
class class1{
var $a1;

function class1()
{
$this->a1 = "hello";
}

function t1()
{
return $this->a1;
}
}
?>
in test.php I have the ff:
<?
include("class1.php");
$obj = new class1();
$a = "test";

die("this is $a message=$obj->t1()");
?>

The message displayed is always:
this is test message=()
instead of :
this is test message=hello

is there another way of doing it aside from:
$x = $obj->t1();
die("this is $a message=$x");


Thanks in advance,
ludwig lim


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html
Ludwig Lim [ Do, 12 Juni 2003 14:05 ] [ ID #46349 ]

Re: Some Questions

Hi Ludwig

die("this is $a message= ".$obj->t1());

or

$msg = $obj->t1();
echo("this is $a message $msg");

works.

Regards
Conni


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
Cornelia Boenigk [ Do, 12 Juni 2003 14:44 ] [ ID #46351 ]
Datenbanken » gmane.comp.db.postgresql.php » Some Questions

Vorheriges Thema: test, please delete
Nächstes Thema: A question on method calling in PHP