Re: Object Array?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2006-05-18 at 14:25, Jay Paulson wrote:
> I tried with no success yesterday to get an answer to this question so I'll
> try again.
> 
> I have an object from using simpleXML and inside that object is an array
> holding even more objects.  However, it's not acting like an array and
> therefore I can't go through it. (i.e. I can't use the count function to see
> how big it is and loop through it)
> 
> This below should be an array:
> 
> $xml->RES->R

Looks ot me like it isn't what it "should" be. It's an object.

Cheers,
Rob.

> 
> When I use print_r($xml->RES->R) I get $xml->RES->R[0] printed, which is
> below:
> 
> SimpleXMLElement Object
> (
>     [U] => http://.../benefits/
>     [UD] => http://.../benefits/
>     [UE] => http://.../benefits/
>     [T] => <b>Benefits</b>
> 
>     [RK] => 10
>     [CRAWLDATE] =>  17 May 2006
>     [FS] => SimpleXMLElement Object
>         (
>         )
> 
>     [S] => Home, <b>Benefits</b> Forms Jobs Training Locations, Who We Are
> E-Info Publications EVA<br> Team Websites. <b>...</b> 2006 <b>Benefits</b>
> Vote. <b>Benefits</b> Links. <b>Benefits</b> Websites. <b>...</b>
>     [LANG] => en
>     [HAS] => SimpleXMLElement Object
>         (
>             [L] => SimpleXMLElement Object
>                 (
>                 )
> 
>             [C] => SimpleXMLElement Object
>                 (
>                 )
> 
>         )
> 
> )
> 
> 
> When I use print_r($xml->RES) I get the below.  As you can see [R] => Array
> but yet in the above example it is an object.  I'm so confused and lost.
> Can anyone help?  PHP version 5.0.4
> 
> SimpleXMLElement Object
> (
>     [M] => 2010
>     [FI] => SimpleXMLElement Object
>         (
>         )
> 
>     [NB] => SimpleXMLElement Object
>         (
>             [NU] =>
> /search?q=benefits&site=default_collection&hl=en&lr=&ie=UTF-8&output=xml_no_
> dtd&client=default_frontend&access=p&sort=date:D:L:d1&start=10&sa=N
>         )
> 
>     [R] => Array
>         (
>             [0] => SimpleXMLElement Object
>                 (
>                     [U] => http://.../benefits/
>                     [UD] => http://.../benefits/
>                     [UE] => http://.../benefits/
>                     [T] => <b>Benefits</b>
> 
>                     [RK] => 10
>                     [CRAWLDATE] =>  17 May 2006
>                     [FS] => SimpleXMLElement Object
>                         (
>                         )
> 
>                     [S] => Home, <b>Benefits</b> Forms Jobs Training
> Locations, Who We Are E-Info Publications EVA<br> Team Websites. <b>...</b>
> 2006 <b>Benefits</b> Vote. <b>Benefits</b> Links. <b>Benefits</b> Websites.
> <b>...</b>  
>                     [LANG] => en
>                     [HAS] => SimpleXMLElement Object
>                         (
>                             [L] => SimpleXMLElement Object
>                                 (
>                                 )
> 
>                             [C] => SimpleXMLElement Object
>                                 (
>                                 )
> 
>                         )
> 
>                 )
> 
>             [1] => SimpleXMLElement Object
>                 (
>                     [U] => http://.../benefits/benefits_websites.html
>                     [UD] => http://.../benefits/benefits_websites.html
>                     [UE] => http://.../benefits/benefits_websites.html
>                     [T] => <b>Benefits</b>
> 
>                     [RK] => 9
>                     [CRAWLDATE] =>  17 May 2006
>                     [FS] => SimpleXMLElement Object
>                         (
>                         )
> 
>                     [S] => Home, <b>Benefits</b> Forms Jobs Training
> Locations, Who We Are E-Info Publications<br> EVA Team Websites.
> <b>Benefits</b> Websites.  <b>...</b>
>                     [LANG] => en
>                     [HAS] => SimpleXMLElement Object
>                         (
>                             [L] => SimpleXMLElement Object
>                                 (
>                                 )
> 
>                             [C] => SimpleXMLElement Object
>                                 (
>                                 )
> 
>                         )
> 
>                     [HN] => /benefits
>                 )
> 
>             [2] => SimpleXMLElement Object
>                 (
>                     [U] => http://www..com/jobs//benefits.html
>                     [UD] => http://www..com/jobs//benefits.html
>                     [UE] => http://www..com/jobs//benefits.html
>                     [T] =>  : Jobs :
>                     [RK] => 10
>                     [FS] => SimpleXMLElement Object
>                         (
>                         )
> 
>                     [S] => <b>...</b> <b>Benefits</b> Summary. <b>...</b>
> The <b>Benefits</b> of a Unique Culture. At<br>  <b>...</b> success. Medical
> Care <b>Benefits</b>. Available after <b>...</b>
>                     [LANG] => en
>                     [HAS] => SimpleXMLElement Object
>                         (
>                             [L] => SimpleXMLElement Object
>                                 (
>                                 )
> 
>                             [C] => SimpleXMLElement Object
>                                 (
>                                 )
> 
>                         )
> 
>                 )
> 
> Etc......
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux