0

When I run this, it works: $content = get_content(); echo $content['content']; but when I run this echo get_content()['content']; I get Parse error: syntax error, unexpected '[', expecting ',' or ';'

Is there a way around this? I can provide the actual get_content() function if that is necessary but thought I'd start here.

Thanks!

7
  • what you want to do ? Commented Dec 3, 2019 at 20:48
  • What version of PHP are you running? Commented Dec 3, 2019 at 20:49
  • @PatrickQ 5.3.29 Commented Dec 3, 2019 at 20:51
  • Ah I see that it’s only from 5.4 and up. Close :) Commented Dec 3, 2019 at 20:52
  • 1
    @SeaBass That's a big "Yikes!" there. You should not be using a version that old. I won't lecture you on that though. The flagged duplicate answers your question. Commented Dec 3, 2019 at 20:52

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.