Dear Jodi,
Comple the following your modified code which works
correctly:
<?php
class abjad
{
var $a;
function setA()
{
$this->a = "first alpha";
}
function showA()
{
echo $this->a."\n";
}
}
$alpha = new abjad();
$alpha->setA();
$alpha->showA();
?>
Just add this pointer to variable.
Thanks and regards,
Arun
--- "Jodi.AU" <[EMAIL PROTECTED]> wrote:
---------------------------------
hello all... :)
I made a class with two functions ini it.
function setA( ) and function showA( ).
inside the first function I declare $a = "first
alpha";
How can I display $a variable with echo $a; from the
second function....?
I tried with the codes below, still display nothing.
Thanks for all the help....
Jodi
codes:
<?php
/* remove this
class abjad
{
var $a;
function setA()
{
$a = "first alpha";
}
function showA()
{
echo $a."\n";
}
}
$alpha = new abjad();
$alpha->showA();
*/
?>
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
SPONSORED LINKS
Php
mysql Job postings
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "php-list" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo!
Terms of Service.
---------------------------------
__________________________________________________________
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~->
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/