Reputation: 3469
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 '
?
Upvotes: 0
Views: 50
Reputation: 66
print "This is my car number {$this->attr['number']} ... \n";
Putting variable in {} should solve your problem, because php evaluate it as one variable
Upvotes: 4