Skip to content
/ ivory Public

Ivory is a practical, efficient and reusable PHP function toolkit. Help developers develop PHP applications more efficiently.

License

Notifications You must be signed in to change notification settings

naroat/ivory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 中文



PHP version Composer version License

What is Ivory?

Ivory is a practical, efficient and reusable PHP function toolkit. Help developers develop PHP applications more efficiently. The tools included in Ivory are:

  • String
  • Array
  • Data & Time
  • Cryptor
  • File
  • Network
  • validator

Documentation:https://naroat.github.io/ivory/

Installation

Version requirements:

  • PHP >= 7.2
  • composer >= 2.0

Installation:

composer require naroat/ivory

Use

Example: Find the number of days between two dates:

$startDate = '2024-10-03';
$endDate = '2024-12-10';
$res = \Naroat\Ivory\DateTime\DateTime::dateDiff($startDate, $endDate);
var_dump($res);
//output:
//int(68)

Example: Example of a private email

$res = \Naroat\Ivory\Str\Str::hideEmail('[email protected]');
var_dump($res);
//output: "foo***@bar.com"

$res = \Naroat\Ivory\Str\Str::hideEmail('[email protected]', '---@');
var_dump($res);
//output: "[email protected]"

More

For more features, please refer to API.

About

Ivory is a practical, efficient and reusable PHP function toolkit. Help developers develop PHP applications more efficiently.

Topics

Resources

License

Stars

Watchers

Forks

Languages