My apologies for this PHP noob question, but I cannot find the proper syntax to get at the data from this array I'm using.

I am using the following code "see inside" my array:

print_r($node_extras->field_show_page_title);

and that produces the following result when I look at the page:

Array ( [0] => Array ( [value] => supress ) )

GREAT, RIGHT!? Well, I just don't know how to go that extra step and get the right syntax to have it spit out JUST the word supress (and yea, I know I'm spelling "supress" incorrectly)

Comments

styro’s picture

$variable[0]['value']

--
Anton
New to Drupal? | Troubleshooting FAQ
Example knowledge base built with Drupal

AndrewJarvis’s picture

Yea, someone answered it just as you were posting that aprently! Thanks to you too!

AndrewJarvis’s picture

For anyone interested, the answer turned out to be:

print($node_extras->field_show_page_title[0]['value']);

Thanks Steve!

archard’s picture

Just to let you know, print isn't actually a function, so it should be

print $node_extras->field_show_page_title[0]['value'];

They both work, but it 'should' be written without the parenthesis.