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 7492853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:37:10+00:00 2026-05-29T16:37:10+00:00

I have a very simple xml content videolar.xml . Flash player takes these elements

  • 0

I have a very simple xml content videolar.xml. Flash player takes these elements and plays them. I want to change the <title> and <youtube> elements by php simplexml. I wrote a code video.php to change these elements. When I run video.php it prints like below. It looks like it works, but if I play the player it plays led zeppelin still, and does not play whitesnake. If I open video.xml by browser I see that xml file has not changed. Still led zeppelin. So how can I update flashplayer’s playlist?

videolar.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <playlist>
    <track>
      <title>led zeppelin - kashmir</title>
      <youtube>sfR_HWMzgyc</youtube>
    </track>
    <track>
      <title>pink floyd - eclipse</title>
      <youtube>BUwUKyztI10</youtube>
    </track>
  </playlist>

video.php

<?php
  $completeurl = $_SERVER['DOCUMENT_ROOT'].'/ytplayer/videolar.xml';
  $xml = simplexml_load_file($completeurl);

  $xml->track[0]->title = 'Whitesnake - Is this love';
  $xml->track[0]->youtube = 'GOJk0HW_hJw';

  print_r($xml);
?>

When I run this code above it prints:

(
  [track] => Array
  (
    [0] => SimpleXMLElement Object
    (
      [title] => Whitesnake - Is this love
      [youtube] => GOJk0HW_hJw
    )
    [1] => SimpleXMLElement Object
    (
      [title] => pink floyd - eclipse
      [youtube] => BUwUKyztI10
    )
  )  
)
  • 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-29T16:37:12+00:00Added an answer on May 29, 2026 at 4:37 pm

    You need to save modified xml back into file

    <?php
        $completeurl = $_SERVER['DOCUMENT_ROOT'].'/ytplayer/videolar.xml';
        $xml = simplexml_load_file($completeurl);
    
        $xml->track[0]->title = 'Whitesnake - Is this love';
        $xml->track[0]->youtube = 'GOJk0HW_hJw';
    
        $xml->asXML($completeurl)
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some very simple XML: <properties> <property> <name>BobFish</name> <explaination>Bob is a fish.</explaination> </property>
i have this very simple download page to get an xml file. the script
I'm a beginner at XSL FO. I have a very simple XML document :
I have some very simple xml and xslt documents, which render in IE8 in
I want to do a very simple thing. I have a listview in my
I have a very simple XML file, that looks like this: <Data><Day Num=4197> <Date>270611</Date>
I already have a very simple threading XML-RPC server in Python: from SocketServer import
i have very simple problem. I need to create model, that represent element of
I have very simple select like this: SELECT * FROM table WHERE column1 IN
I have very simple window where I have 2 buttons - one for cancel,

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.