So I am trying to run some PHP code inside of Drupal (inside of a node, with PHP code parsing enabled).
I’m trying to get the data from a field, in this case a simple text field.
I am getting that information displayed, but also this error:
Notice: Use of undefined constant value - assumed 'value' in eval() (line 8 of /hermes/waloraweb033/b418/moo.arao1989/modules/php/php.module(80) : eval()'d code).
Notice: Use of undefined constant value - assumed 'value' in eval() (line 8 of /hermes/waloraweb033/b418/moo.arao1989/modules/php/php.module(80) : eval()'d code).
My code is as follows:
<?
if ($node = menu_get_object()) {
$test = field_get_items('node', $node, 'field_testvalue');
$supertest = $test[0];
echo $supertest[value];
} ?>
Ah, I ask dumb questions sometimes.
You need strings when you reference array keys in an associative array: