SlappyTheFish
11-01-2006, 08:23 AM
I am trying to invoke a function of an object that is returned by running another function.
Here is my code:
$object = $this->OM->searchChildren('title');
$this->title = $object[0]->collateCharacterData();
This works, but is there a neater way to do this in one line? I have tried the following, but it doesn't work:
$this->title = $this->OM->searchChildren('title')[0]->collateCharacterData();
Any suggestions?!
Here is my code:
$object = $this->OM->searchChildren('title');
$this->title = $object[0]->collateCharacterData();
This works, but is there a neater way to do this in one line? I have tried the following, but it doesn't work:
$this->title = $this->OM->searchChildren('title')[0]->collateCharacterData();
Any suggestions?!