I'm using node_load to load a node based on the value of one of its fields. If the field I'm testing against were uid
for example, I would do it like this:
$n1 = node_load(array('uid' => $val));
but this field sub1
is nested in an array field_val[0][sub1]
. I tried putting quotes around the whole thing, but it didn't work. I tried other small variations, but none worked.
$n1 = node_load(array('field_val[0][sub1]' => $val));
I'm wondering what's the correct syntax for doing this, if it can be done.