PHP code example of brainite / splash

1. Go to this page and download the library: Download brainite/splash 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/ */

    

brainite / splash example snippets

 
$objects = new RegexIterator(new RecursiveIteratorIterator(
  new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST),
  '/^.+\.php$/i');
foreach ($objects as $object) {}

\Splash\Splash::mount();
$objects = splash($path)->recursiveDirectory()
  ->recursiveIterator(RecursiveIteratorIterator::SELF_FIRST)
  ->regex('/^.+\.php$/i');
foreach ($objects as $object) {}

use Splash\Splash;
$test = new Splash();
$test->push(1)->push(2)->push(3);

use Splash\Splash;
$test = Splash::go()->push(1)->push(2)->push(3);
 
use Splash\Splash;
$test = Splash::go()->push(1, 2, 3);

\Splash\Splash::mount();
$test = splash(1, 2, 3);
` php
/**
 * Callback for CallbackIterator
 *
 * @param $current   Current item's value
 * @param $key       Current item's key
 * @param $iterator  Iterator being traversed
 * @param $new_iterator Iterator being built (to allow item splits)
 * @return boolean   TRUE to auto-add the current item to $new_iterator, FALSE otherwise
 */
function my_callback(&$current, $key, $iterator, &$new_iterator) {
  $current = 'a';
  return TRUE;
}

$dat = splash('a', 'b', 'c')->callback('my_callback')->toArray();
// $dat == array('a', 'a', 'a')