#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2008
    Posts
    2
    Rep Power
    0

    Iterating through an object


    Hi guys
    I have the following object, and I want to know how to loop through it to get to FileName elements.

    Thanks in advance


    stdClass Object
    (
    [FileDataModel] => Array
    (
    [0] => FileDataModel Object
    (
    [FileData] =>
    [FileFullName] =>
    [FileName] => c:\Inbound\4\fnAck_Ack_1103_200751980.xml.0
    )

    [1] => FileDataModel Object
    (
    [FileData] =>
    [FileFullName] =>
    [FileName] => c:\Inbound\4\fnAck_Ack_1104_209137967.xml.0
    )
    )
    )
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    PHP Code:
    foreach ($your_object->FileDataModel as $file) {
        
    $file_name $file->FileName;
        ...


IMN logo majestic logo threadwatch logo seochat tools logo