0

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’) ?>

2 Answers 2

6

What kind of apostrophe is that?

�?no category’

Should be

'no category'
Sign up to request clarification or add additional context in comments.

1 Comment

Hah! Good catch, thanks. It was originally copypasted from a forum thread, so that's probably where the weird apostrophe came in. Thanks, that fixed the error :)
2

; at the end of the statement?

1 Comment

Thanks, tried that and it didn't work. @Gumbo Thanks for the tip

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.