<?
class generic
{
var $test_1;
var $test_2;
function set_var($var_1, $var_2)
{
$this->test_1 = $var_1;
$this->test_2 = $var_2;
}
}
$something = new generic;
$something->set_var(10, 12);
echo $something->test_1 . "<br>\n";
echo $something->test_2 . "<br>\n";
?>
all classes do is organize data, its a nice way of doing it too. all the ->
is access that data/function.
Im not quite sure what you mean when you say "generic-> becomes something
twice" as far as I can see, nothing is becoming nothing.
Chris Lee
Mediawaveonline.com
""Karl J. Stubsjoen"" <[EMAIL PROTECTED]> wrote in message
008201c0863a$62814cc0$0afc020a@kstubsjoen">news:008201c0863a$62814cc0$0afc020a@kstubsjoen...
> Aisch! Hmmm... yep, clear as mud. Let me describe what I we have going
on:
>
> We have a function called ToForm which looks like it verifies values
coming
> in from a POST. This function is invoked like this:
>
> $generic->ToForm("cart_id", NO_DEFAULT_VALUE);
> $generic->ToForm("email_address", NO_DEFAULT_VALUE);
>
> I don't understand the $generic-> and what happens when it "becomes"
> something twice. The ToForm function looks like this:
>
> function ToFORM($val, $default, $makeuppercase=0) {
> global $FORM, $$val;
> if(!empty(${$val}))
> $FORM[$val] = trim(${$val});
> else if($default != NO_DEFAULT_VALUE)
> $FORM[$val] = $default;
> if($makeuppercase)
> $FORM[$val] = strtoupper($FORM[$val]);
> }
>
> Thanks for the help!
>
> Karl
>
>
> ----- Original Message -----
> From: "Cal Evans" <[EMAIL PROTECTED]>
> To: "Karl J. Stubsjoen" <[EMAIL PROTECTED]>; "PHP Mailing List"
> <[EMAIL PROTECTED]>
> Sent: Wednesday, January 24, 2001 12:08 PM
> Subject: RE: [PHP] ->
>
>
> > It's means that what's on the right is part of the object on the left.
> >
> > i.e.
> >
> > $myObject->myMethod();
> >
> > fires the method myMethod() of the object $myObject.
> >
> > echo $myObject->myAttribute;
> >
> > displays the value of the attribute myAttribute of the object $myObject.
> >
> > Clear as mud? ;)
> >
> > Cal
> > http://www.calevans.com
> >
> >
> > -----Original Message-----
> > From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 24, 2001 1:05 PM
> > To: PHP Mailing List
> > Subject: [PHP] ->
> >
> >
> > What does -> do?
> > As in:
> > $Something->then_something_over_here
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]