[support] Accessing data from array $data
Mitch Albert
mitch at betawerk.nl
Mon Nov 21 15:08:55 UTC 2011
Hey Néstor,
to get the url you do:
$data->data_info->tables['where']['fields']['feed_node_item_url']['field']
the difference between -> and [] is
use -> when its a Object
use [] when its a array
that answers your question?
Op 16-11-2011 0:23, Néstor schreef:
>
> I fixed the code up a little bit. I was missing some parenthesis and
> I put a 4data instead of $data :-)
> On Tue, Nov 15, 2011 at 3:06 PM, Néstor <rotsen at gmail.com
> <mailto:rotsen at gmail.com>> wrote:
>
> I am confused,
>
> I did a print_r ($data) and it returned the following:
>
> stdClass Object (
> [date_info] => stdClass Object (
> [tables] => Array (
> [where] => Array (
> [fields] => Array (
> [feeds_node_item_url] => Array (
> [field] => url
> [table] => feeds_node_item
> [alias] => feeds_node_item_url ))))))
>
> How do I obtain the the url?
> How do I obtain the value from an Object?
> Is the url a VALUE or is it a KEY?
>
> All I can think is that if I am in *tables *I can get the value
> myurl = tables['where']['fields']['feeds_node_item']['field']->url;
> print myurl;
>
> Any ideas?
>
> Thanks,
>
> Néstor
>
>
>
>
--
Betawerk <http://www.betawerk.nl> *Mitch Albert* LinkedIn
<http://nl.linkedin.com/in/mitchalbert>
Senior Developer
mitch at betawerk.nl <mailto:mitch at betawerk.nl>
*Betawerk*
Pancratiusstraat 30
6411 KC Heerlen
www.betawerk.nl <http://www.betawerk.nl>
Service desk open van 9:00 - 12:00 en 13:00 - 16:30
Telefoon 045 - 574 11 81
support at betawerk.nl <mailto:support at betawerk.nl>
/Dit e-mailbericht is uitsluitend bestemd voor de geadresseerde. Als dit
bericht niet voor u bestemd is, wordt u vriendelijk verzocht dit aan de
afzender te melden. Aan dit bericht kunnen geen rechten worden ontleend./
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20111121/194f264d/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: betawerk.gif
Type: image/gif
Size: 364 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/support/attachments/20111121/194f264d/attachment.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linkedin.gif
Type: image/gif
Size: 1017 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/support/attachments/20111121/194f264d/attachment-0001.gif
More information about the support
mailing list