title: Php cant write to xml with 7000 Lines
body: <p>I have a PHP script in which you can add text in some fields.
  The PHP script adds the text which are in the fields in 2 xml files.
  It is working good, but if the xml is getting too big (7000 lines is my xml), it can't write anymore.</p>
  
  <p>I changed my php.ini into this</p>
  
  <pre><code>max_execution_time = 300     
  max_input_time = 900    
  ;max_input_nesting_level = 64 ; Maximum input variable nesting level
  memory_limit = 512M   
  </code></pre>
  
  <p>So is this problem caused by the php.ini or in PHP file.
  The script will only work when I delete a piece of xml code.</p>
  
  <p>here is php</p>
  
  <pre><code>ini_set('default_charset', 'utf-8');
  if(isset($_POST['post']) &amp;&amp; $_POST['post']=='true')
  
  {$file1Content = '&lt;?xml version="1.0"?&gt;
  &lt;channels&gt;';
  for($j=0; $j &lt; $_POST['total1']; $j++)
  {if(isset($_POST['checkbox1'.$j]) &amp;&amp; $_POST['checkbox1'.$j]=="on")
  {$file1Content .="
  &lt;channel&gt;
  &lt;title&gt;".$_POST['checkbox1'.$j.'_title']."&lt;/title&gt;
  &lt;img&gt;".$_POST['checkbox1'.$j.'_img']."&lt;/img&gt;
  &lt;info&gt;".$_POST['checkbox1'.$j.'_info']."&lt;/info&gt;
  &lt;url&gt;".$_POST['checkbox1'.$j.'_url']."&lt;/url&gt;
  &lt;/channel&gt;";}}
  $file1Content .= "&lt;/channels&gt;";
  $fileHandle = fopen($file1,"w");
  fwrite ($fileHandle, $file1Content);
  fclose ($fileHandle);
  
  
  if (isset($_POST['post']) &amp;&amp; $_POST['post']=="true" &amp;&amp; $_POST['title']!='')
  $fileContent = file_get_contents($file1);
  $fileNewXml = "
  &lt;title&gt;".$_POST['title']."&lt;/title&gt;
  &lt;img&gt;".$_POST['image']."&lt;/img&gt;
  &lt;info&gt;".$_POST['info']."&lt;/info&gt;
  &lt;url&gt;".$_POST['url']."&lt;/url&gt;";  
   //Place elemnt in the right place
   $pos=$_POST['pos1'];   
  $allTags=explode("&lt;channel&gt;",$fileContent,strlen($fileContent));
  if(count($allTags)==1) //if file is empty
  {$fileNewContent='&lt;?xml version="1.0"?&gt;
  &lt;channels&gt;
  &lt;channel&gt;"'.$fileNewXml.'&lt;/channel&gt;&lt;/channels&gt;';}
  
      $fileHandle = fopen($file1,"w");
  
  fwrite ($fileHandle, $fileNewContent);
  
  fclose ($fileHandle);
  
  
  
  &lt;?php
  
                      $content= file_get_contents($file1);
  
                      $arr = simplexml_load_string($content);
  
                      $i=1;
  
                      foreach ($arr as $element)
  
                      { 
  
                          echo "&lt;option value='$i'&gt;$element-&gt;title&lt;/option&gt;"; 
  
                          $i++;
  
                      }       
  
                  ?&gt;
  </code></pre>