Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7418935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:58:29+00:00 2026-05-29T07:58:29+00:00

I want to get information from Plex Media Server trough foreach . I have

  • 0

I want to get information from Plex Media Server trough foreach. I have succeeded fetching the content from an URL but I can’t get the information I want to print out on the page.

This is the var_dump from the URL:

object(SimpleXMLElement)[1]
  public '@attributes' => 
    array
      'size' => string '349' (length=3)
      'mediaTagPrefix' => string '/system/bundle/media/flags/' (length=27)
      'mediaTagVersion' => string '1322272914' (length=10)
      'sortAsc' => string '1' (length=1)
      'viewGroup' => string 'movie' (length=5)
      'viewMode' => string '458803' (length=6)
      'art' => string '/:/resources/movie-fanart.jpg' (length=29)
      'title1' => string 'Filmer' (length=6)
      'identifier' => string 'com.plexapp.plugins.library' (length=27)
  public 'Video' => 
    array
      0 => 
        object(SimpleXMLElement)[2]
          public '@attributes' => 
            array
              ...
          public 'Media' => 
            object(SimpleXMLElement)[351]
              ...
          public 'Genre' => 
            array
              ...
          public 'Writer' => 
            array
              ...
          public 'Director' => 
            object(SimpleXMLElement)[356]
              ...
          public 'Country' => 
            object(SimpleXMLElement)[357]
              ...
          public 'Role' => 
            array
              ...
  1 => 
    object(SimpleXMLElement)[3]
      public '@attributes' => 
        array
          ...
      public 'Media' => 

And so on...

This is the print_r data from the URL:

SimpleXMLElement Object ( [@attributes] => Array ( [size] => 349 [mediaTagPrefix] => /system/bundle/media/flags/ [mediaTagVersion] => 1322272914 [sortAsc] => 1 [viewGroup] => movie [viewMode] => 458803 [art] => /:/resources/movie-fanart.jpg [title1] => Filmer [identifier] => com.plexapp.plugins.library ) [Video] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [ratingKey] => 2663 [key] => /library/metadata/2663 [studio] => Touchstone Pictures [type] => movie [title] => 10 Things I Hate About You [contentRating] => PG-13 [summary] => "10 Things I Hate About You" är en amerikansk långfilm från 1999 i regi av Gil Junger. När Cameron börjar high school förälskar han sig snabbt i den söta Bianca. Han hjälper henne med hemläxorna i franska för att få henne att bli intresserad av honom. När han ber att få gå på skolbalen med henne får han dock veta att hennes pappa har bestämt att hon inte får gå på dejt så länge Biancas syster Kat är singel. Kat är ständigt på dåligt humör och ovänlig och definitivt inte någon man vill gå på dejt med. Cameron måste också konkurrera om Biancas gunst med snyggingen Joey. Cameron kommer då på en plan: att be Pat, som enligt ryktet har sålt sin lever för att köpa högtalare, att gå med Kat på skolbalen mot betalning. [rating] => 7 [year] => 1999 [thumb] => /library/metadata/2663/thumb?t=1328119876 [art] => /library/metadata/2663/art?t=1328119876 [duration] => 5940000 [originallyAvailableAt] => 1999-03-31 [addedAt] => 1328119758 [updatedAt] => 1328119876 ) [Media] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 2614 [duration] => 5611000 [bitrate] => 1021 [width] => 544 [height] => 304 [aspectRatio] => 1.78 [audioChannels] => 2 [audioCodec] => mp3 [videoCodec] => mpeg4 [videoResolution] => sd [container] => avi [videoFrameRate] => PAL [optimizedForStreaming] => 0 ) [Part] => SimpleXMLElement Object ( [@attributes] => Array ( [key] => /library/parts/2628/file.avi [duration] => 5611000 [file] => G:\Movies\10 things that I hate about you (1999)\10 things that I hate about you (1999).avi [size] => 733679616 ) ) ) [Genre] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [tag] => Coming of age ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [tag] => Komedi ) ) ) [Writer] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [tag] => Karen McCullah Lutz ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [tag] => Kirsten Smith ) ) ) [Director] => SimpleXMLElement Object ( [@attributes] => Array ( [tag] => Gil Junger ) ) [Country] => SimpleXMLElement Object ( [@attributes] => Array ( [tag] => USA ) ) [Role] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [tag] => Allison Janney ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [tag] => Larry Miller ) ) [2] => SimpleXMLElement Object ( [@attributes] =>

This is the code I have right now:

$url = 'http://localhost:32400/library/sections/12/all';
$achxml = simplexml_load_file($url);
foreach($achxml->attributes AS $ach) {
    echo $ach->Video['title'].'<br>';
}

The only thing I getting out of this is… well – nothing! It doesn’t print out anything at all! So I’m asking you now, what’s wrong with my foreach? You can read more about PlexNine or what they now calling it, here: http://wiki.plexapp.com/index.php/PlexNine_AdvancedInfo

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:58:30+00:00Added an answer on May 29, 2026 at 7:58 am

    I got this working now! Here’s the solution:

    foreach($achxml->Video AS $child) {
        echo $child['title'];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this site I want to get information from. To get the file
I want to get show information from myspace artists. One way I could do
Just I am learning MVC,(ofcourse i get enough information from MS Website).I want to
http://www.dsebd.org/latest_PE.php The above url contain several information .From this url i just want to
I want to get page_tag information from the page and want to make sure
I want to send some information from PHP to Java. Why? Because I have
How can I get information from my datable? I just want to get column
I want to extract from a String formatted information. Let's say I have these
If I want to use completion port to get information from different thread ,
I have a JSP and I want to fill some fields with information from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.