23.15.1. ProblemYou want to send output to more than one filehandle; for example, you want to log messages to the screen and to a file. 23.15.2. SolutionWrap your output with a loop that iterates through your filehandles, as shown in Example 23-38. pc_multi_fwrite( )
23.15.3. DiscussionIf you don't want to pass a length argument to fwrite( ) (or you always want to), you can eliminate that check from your pc_multi_fwrite( ). The version in Example 23-39 doesn't bother with a $length argument. pc_multi_fwrite( ) without $length
23.15.4. See AlsoDocumentation on fwrite( ) at http://www.php.net/fwrite. |