PHP code example of smartel1 / array-fixer
1. Go to this page and download the library: Download smartel1/array-fixer 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/ */
smartel1 / array-fixer example snippets
'providers' => [
...
Smartel1\ArrayFixer\ArrayFixerServiceProvider::class,
]
public function someFunction(ArrayFixer $fixer)
{
$array = [['key'=>'123'],['key'=>2]];
$rules = ['key'=>'integer|
$rules = ['key1.key2'=>'integer'];
$rules = ['key1.*.key2'=>'integer']; //Применение правила integer к полю key2 всех элементов поля key1