title: How to change value of cdata inside a .xml file and then again save it using php
body: <p>i want to just change ABCD written inside cdata of data.xml file with a new value held by $change by php. i am able to get all cdata value using the following code but don't know how to change and save it.</p>
  
  <pre><code>&lt;?php
  $doc = new DOMDocument();
  $doc-&gt;load('data.xml');
  $destinations = $doc-&gt;getElementsByTagName("text");
  foreach ($destinations as $destination) {
      foreach($destination-&gt;childNodes as $child) {
          if ($child-&gt;nodeType == XML_CDATA_SECTION_NODE) {
              echo $child-&gt;textContent . "&lt;br/&gt;";
          }
      }
  }
  ?&gt;
  </code></pre>
  
  <p><strong>my data.xml file.</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;data displayWidth="" displayHeight="" frameRate="" fontLibs="assets/fonts/Sansation_Regular.swf"&gt;
      &lt;preloader type="snowflake" size="40" color="0xffffff" shapeType="circle" shapeSize="16" numShapes="8"/&gt;
          &lt;flipCard openingDuration="2" openCardZ="400" tweenMethod="easeOut" tweenType="Back"&gt;
              &lt;video videoPath="video.MP4" frontImage="assets/christmas/front.jpg" videoPoster="assets/christmas/videoPoster.jpg" videoFrame="assets/christmas/videoFrame.png" bufferTime="10" loopVideo="true"/&gt;
              &lt;flips backImage="assets/christmas/back.jpg" backColor="0x808080"&gt;
  
              &lt;flip isText="true" xPos="600" yPos="470" openDelay="8" openDuration="2" tweenMethod="easeOut" tweenType="Elastic" action="link" url="http://activeden.net/"&gt;
                  &lt;text id="name" font="Sansation_Regular" embedFonts="true" size="40" color="0x802020"&gt;&lt;![CDATA[ABCD]]&gt;&lt;/text&gt;
              &lt;/flip&gt;
  
              &lt;flip isText="true" xPos="300" yPos="30" openDelay="2" openDuration="2" tweenMethod="easeOut" tweenType="Elastic"&gt;
                  &lt;text font="Sansation_Regular" embedFonts="true" size="80" color="0x202020"&gt;&lt;![CDATA[HAPPY]]&gt;&lt;/text&gt;
              &lt;/flip&gt;
          &lt;/flips&gt;
      &lt;/flipCard&gt;
  &lt;/data&gt;
  </code></pre>