PHP - Broken variable content
<p>as the subject, I have a problem with the content of a variable.
Within into this variable is inserted a <code>base64</code> of a file (extracted from an xml) and PHP the base64 to save the file in the filesystem.
Everything is fine as long as there are small files (about 10MB) ... however the <code>base64</code> with a file bigger the <code>base64</code> seems to be "broken" after 9999993 characters.
I say seems because if I go to the debug display the value of the variable I see all of the <code>base64</code> string.</p>

<p>The problem is not in saving the file, because the file is created and saved correctly, but the content of the variable. Are there any limits to be set on php.ini? Or are there ways to remedy the problem? I also tried to split the string in chunks or in an array, but the problem remains.</p>

<p>I put the code I use to extract data from XML:</p>

<pre><code>    $reader = new XMLReader(); 

    if (!$reader-&gt;open($GLOBALS['conf']['filepath'] . '/' . $xmlfile)) { 
        print "Error to open XML: $xmlfile\n"; 
    } else { 
        while ($reader-&gt;read()) { 
            $name = $reader-&gt;name; 
            $type = $reader-&gt;nodeType; 
            if (($type == XMLReader::ELEMENT) &amp;&amp; in_array($name, $allowedNodes)) { 
                $xml = $reader-&gt;readOuterXml(); 

                $doc = new DOMDocument('1.0', 'UTF-8'); 
                $xml = simplexml_import_dom($doc-&gt;importNode($reader-&gt;expand(), true)); 

                //Other code
            } 
        } 
    }
</code></pre>

<p>Note:
the variable <code>$allowedNodes</code> is a variable saved in a configuration file, so you do not see its value.</p>

<p>Thanks for the answers</p>
