PHP code example of grayphp / helpers

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

    

grayphp / helpers example snippets


array_get:/**
     * Gets a value in an array by dot notation for the keys.
     *
     * @param string $key
     * @param array  $array
     *
     * @return mixed
     */
array_set:/**
     * Sets a value in an array using the dot notation.
     *
     * @param string $key
     * @param mixed  $value
     * @param array  $array
     *
     * @return bool
     */
array_first:/**
     * Returns the first element of an array.
     *
     * @param array $array
     *
     * @return mixed $value
     */
array_last:/**
     * Returns the last element of an array.
     *
     * @param array $array
     *
     * @return mixed $value
     */
to_array:/**
     * Converts a string or an object to an array.
     *
     * @param string|object $var
     *
     * @return array|null
     */
to_object:/**
     * Converts an array to an object.
     *
     * @param array $array
     *
     * @return object|null
     */
is_assoc:/**
     * Detects if the given value is an associative array.
     *
     * @param array $array
     *
     * @return bool
     */
create_captcha:/**
     * Create a captcha image.
     * @return void
     */
validate_captcha:/**
     * Validate a captcha image.
     * @param string $userInput
     * @return bool
     */