Mark Simpson
Mark Simpson

Reputation: 2374

PHP Parse error: syntax error, unexpected T_STRING

I'm getting this syntax error and I know it's PHP 101, but I wouldn't know php if it hit me over the head with a curly bracket. Any help would be appreciated. Thanks

<?php echo ($this->getProduct()->getCategory() ? $this->getProduct()->getCategory()->getName() : ‘no category’) ?>

Upvotes: 0

Views: 3244

Answers (2)

Overbeeke
Overbeeke

Reputation: 2028

; at the end of the statement?

Upvotes: 2

Ivan Krechetov
Ivan Krechetov

Reputation: 19220

What kind of apostrophe is that?

‘no category’

Should be

'no category'

Upvotes: 6

Related Questions