3

I am trying to grab an object property that has a hashtag in the title. It comments out the rest of the line due to the hashtag.

The current code is:

if ($content->#title == 'News') {

I was thinking that maybe something like if ($content->{#title} == 'News') { would work, but that does not appear to work either. There has to be some way in PHP to access a property of an object with a hashtag on the front of it. How do I do this?

Steven Matthews
  • 9,705
  • 45
  • 126
  • 232

1 Answers1

2
if ($content->{'#title'} == 'News') {

Should do the trick. It at least compiles for me. similar situation/source

Community
  • 1
  • 1
J-Dizzle
  • 3,176
  • 6
  • 31
  • 49