I'm trying this: print "This is my car number $this->attr['number'] ... \n";
But i get this error: Array to string conversion ...
How can i solve this syntax error and use " instead of '?
print "This is my car number {$this->attr['number']} ... \n";
Putting variable in {} should solve your problem, because php evaluate it as one variable
$this->attr['number']is an array. Justvar_dump()it and use the key for which you want the value to be printed.$this->attras the variable.$this->attr['number']outputs an array, just as PHP just told you. You should access values of this array by doing$this->attr['number']['key'].