PHP code example of filipponik / array-analyzer

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

    

filipponik / array-analyzer example snippets


$arrayOfArrays = [
  ['a' => 1, 'b' => 2],
  ['a' => 2, 'c' => 3],
  ['a' => 3],
  ['d' => 'some_string'],
  ['e' => null],
  ['f' => 0.01],
];

$analyzer = new \Filipponik\ArrayAnalyzer\Analyzer();
$analyzedCollection = $analyzer->analyze($arrayOfArrays);

$result = $analyzedCollection->toArray(); // format result to array
$result = $analyzedCollection->toJson(); // format result to JSON

$rules = $analyzer->toLaravelRulesStrings(); // possible laravel validation rules in format '