PHP code example of abollinger / helpers

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

    

abollinger / helpers example snippets

@param array $arr
@return array

$myArray = Helpers::cleanArray([
    "attack" => "<script>alert('Hey, I'm trying to hack you!')</script>"
]);

echo var_dump($myArray);

// output:

array(1) {
    ["attack"]=>
    string(66) "&lt;script&gt;alert('Hey, I'm trying to hack you!')&lt;/script&gt;"
}
@param array $arr
@param array $classes

$myArray = Helpers::printArray([
    "firstName" => "Antoine",
    "lastName" => "Bollinger"
]);

echo $myArray;

// output:

<ul>
    <li>firstName => <strong>Antoine</strong></li>
    <li>lastName => <strong>Bollinger</strong></li>
</ul>
@param array $default
@param array $params
@return array

$params = [
    "firstName" => "Victor"
];

$test = Abollinger\Helpers::defaultParams([
    "firstName" => "Antoine",
    "lastName" => "Bollinger"
], $params);

echo var_dump($test);

// output:
array(2) {
    ["firstName"] => string(6) "Victor"
    ["lastName"] => string(9) "Bollinger"
}
@return array
@param string $dir
@return array
@param array $arr
@param array $arr
@param array $arr
bash
Abollinger/
├── Helpers::
│   ├── cleanArray($array)
│   ├── printArray($array, $classes)
│   ├── defaultParams($default, $array)
│   ├── getYaml($filePath)
│   ├── getScan($dir, $rootDir, $allData)
│   ├── isAssociativeArray($array)
│   ├── largestElementInArray($array)
│   ├── defineConstants($array)
│   ├── getAppSubdirectory($appRoot, $documentRoot)
│   └── getAppCompleteHost()
└── Parsedown::
    └── extends the erusev/parsedown library