PHP code example of webarchitect609 / stream-tools

1. Go to this page and download the library: Download webarchitect609/stream-tools library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webarchitect609 / stream-tools example snippets


    use WebArch\StreamTools\Filter\EndOfLineFilter;
   
    stream_filter_register(EndOfLineFilter::class, EndOfLineFilter::class);
    

    use WebArch\StreamTools\Enum\EndOfLine;
    use WebArch\StreamTools\Filter\EndOfLineFilter;
    /** @var resource $stream */
    stream_filter_append(
        $stream,
        EndOfLineFilter::class,
        STREAM_FILTER_WRITE,
        EndOfLine::WINDOWS
    );
    

    /** @var resource $stream */
    fputs($stream, "All LF symbols\nwill be replaced by CRLF symbols.\nThat's it!");