yii redirect after require

I have a problem i am sending request to saveing data and if is work so i want to do redirect , but i get blank page

//this the function to save 


public function WriteToFileText($array) {


    $filename ='here is the name of the file ,the name is correct and i can print it';


    require($filename); //this sentenct give me the problem





    foreach($array as $key => $value) {


        $text[$key] = array_merge($text[$key],$value);


    }





    //protection <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/huh.gif' class='bbc_emoticon' alt='???' />?


    &#036;tout = &quot;&lt;?php &#092;n&quot;;


    &#036;tout .= '&#036;text = array ( ' . &quot;&#092;n&quot;;


    foreach(&#036;text as &#036;key =&gt; &#036;value)


    {


        &#036;tout .= '    &quot;' . &#036;key . '&quot; =&gt; array( ' . &quot;&#092;n&quot;;


        foreach(&#036;value as &#036;key2 =&gt; &#036;value2)


        {


            &#036;tout .= '        &quot;' . &#036;key2 . '&quot; =&gt; &quot;' . &#036;value2 . '&quot;,'. &quot;&#092;n&quot;;


        }


        &#036;tout .= &quot;    ), &#092;n&quot;;


    }


    &#036;tout .= &quot;); &#092;n&quot;;


    &#036;tout .= &quot;?&gt; &#092;n&quot;;





    &#036;fh = fopen(&#036;filename, &quot;w&quot;) or die(&quot;Could not open log file.&quot;);


    fwrite(&#036;fh, &#036;tout) or die(&quot;Could not write file&#33;&quot;);


    fclose(&#036;fh);


    return true;


}








and if its return me true , i am try do to redirect 


 return Yii::&#036;app-&gt;getResponse()-&gt;redirect('./index.php?r=' . &#036;pages_link[&#036;index + 1])


 


 and the problem that i see blank page ....


 if i will remove the require(&#036;filename); the redirect will work perfect but i will not savind the data becouse i dont get the data from the file what can be the problem?

What is the purpose of ‘require’ ?

Can it be replaced with ‘file_get_contents’ ?

Enable errors with




ini_set('display_errors', true);



at top of the script

[color="#006400"]/* moved from Bug discussions … */[/color]

Probably the file you are requiring has a blank line on the top or on the bottom. Be sure to start the file with "<?php" on the first line, and end it without the closing "?>", otherwise a blank line will be echoed before the app echoes the header for redirect.