if I have a code peice like this...
Code: Select all
$this->variablename = 'blah';Code: Select all
$this->variablename = $this->variablename .= 'blah';Thanks.
Moderator: General Moderators
Code: Select all
$this->variablename = 'blah';Code: Select all
$this->variablename = $this->variablename .= 'blah';Code: Select all
$this->variablename .= 'blah';You've basically done it, just doastions wrote:Is there a shortcut for concating to it?Code: Select all
$this->variablename = $this->variablename .= 'blah';
Code: Select all
$this->variablename .= 'blah';Code: Select all
$this->variablename = $this->variablename . 'blah';To 'instantiate' your class is to create an object instance of the class, e.g.Also is this what is called instantiate?
Code: Select all
class Foo
{
private $data;
public function __construct() {
$this->data = 'Foo';
}
public function getData() {
return $this->data;
}
}
// instantiate an object
$newFooObject= new Foo();
// the object $newFooObject is an instance of the class 'Foo'
// use the new instance to 'do something'
echo $newFooObject->getData();