https://github.com/josephnc/phpfuncs
PHP user defined functions for quick use on your projects.
https://github.com/josephnc/phpfuncs
php php-functions
Last synced: 11 months ago
JSON representation
PHP user defined functions for quick use on your projects.
- Host: GitHub
- URL: https://github.com/josephnc/phpfuncs
- Owner: JosephNC
- License: mit
- Created: 2018-04-28T03:57:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-02T09:52:10.000Z (over 6 years ago)
- Last Synced: 2025-01-31T10:34:02.394Z (about 1 year ago)
- Topics: php, php-functions
- Language: PHP
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHPFuncs
PHP user defined functions for quick use on your projects.
Installation
------------
PHP 5.6+ is required.
```
composer require josephnc/phpfuncs
```
Usage
-------
```php
require_once __DIR__ . '/vendor/autoload.php';
#use function JosephNC\PHPFuncs\;
use function JosephNC\PHPFuncs\real_ip;
use function JosephNC\PHPFuncs\is_array_equal;
$array1 = [
'foo' => 'bar',
'bar' => 'foo',
];
$array2 = [
'bar' => 'foo',
'foo' => 'bar',
];
$ip_address = real_ip();
$equal = is_array_equal($array1, $array2);
echo 'Here is your IP Address: ' . $ip_address . '
';
if ($equal) {
echo 'Your arrays are equal!';
} else {
echo 'Your arrays are not equal.';
}
```
Output:
```
Here is your IP Address: 127.0.0.1
Your arrays are equal!
```
New Functions
-------
If you will like your custom functions to be added to this repository, please contact me.
Thanks.