PHP code example of clarence / matrix

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

    

clarence / matrix example snippets


$data = Matrix::from($dataSource)
      ->select(array('productId' => 'id', 'productName'))
      ->where(function ($row) {
          return $row['id'] > 5;
      })
      ->orderBy('id', SORT_DESC)
      ->indexedBy('productName')
      ->toArray();