Download the PHP package peterujah/php-functions without Composer
On this page you can find all versions of the php package peterujah/php-functions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download peterujah/php-functions
More information about peterujah/php-functions
Files in peterujah/php-functions
Package php-functions
Short Description Wrapped all basic reusable php function which I always on on project.
License MIT
Homepage https://github.com/peterujah/php-functions
Informations about the package php-functions
php-functions
Wrapped all basic reusable php function which is always useful while working on other project. This class might also be useful to beginners
This class provides general-purpose PHP functions to process several functions, it can perform several types of manipulation of string values and other executions.
Currently, it can:
- Create a random value string, int, key, salt or letters of a given length
- Convert timestamp values into a time format for use on social media sites or forum comments
- Generate and validate a unique identifier string
- Generate Unified Public Consultation (UPC)
- Generate European Article Number (EAN) or (EAN13)
- Genrate Big Integer based on min and max
- Check if a string is a valid email address
- Check a password complexity count, using general secure password pattern
- Encrypt password string to create a hash value
- Decrypts a password hash and verifies if it matches
- Calculate a list of item's average rating point
- Formats a currency value to add decimal places
- Discount a value by percentage
- Increase a value by percentage
- Fixed or Round a number to counts
- Creates a badge from an array
- Creates a button badge from an array
- Gets the current user's IP address
- Get the list of hours
- Format the user input to protect again cross site scripting attacks
- Convert string characters to HTML entities
- Copy files and folder to a new directory
- Serve a file for download on the browser
- Truncate text
- Base64 encoded string to a parameter in a URL
- Base64 decode encoded URL encoded string
- Stripe unwanted characters from a string
- Extract domain name from subdomain demo.example.com
- Mask email address
- Mask string by position
- Deletes files and folders
- Write a new log line
- Save log and replace old content
- Find the log file
Installation
Installation is super-easy via Composer:
Usages
Or extend the class and create your own new function like below.
And call initialize your custom class
Available Static Methods
Make a random string/number
Make a time ago from php timestamp, returns string
Generate a uuid string, returns string
Verify a uuid string return true or false
Verify email address is valid or not return true or false
Create a password hash key
Verify a password against hash key
Check password strength
Extract main domain name from subdomain
Calculate items average rating point
Format number to money
Discount from an (int, float, double) value by percentage
Increase interest of an (int, float, double) value by percentage
Fixed/Round a number
Randome number using min and max
Create a tag/badge from array
Create a button tag/badge from array
Returns user ip address
List time hours, returns array
Secure/format user input based on required data type
Formats Convert string characters to HTML entities
Generate UPC product id
Generate EAN13 id
Copy files and folder to a new directory
Copy files and folder to a new directory
Truncate text based on length
Base64 encode string for url passing
Base64 decode encoded url encoded string
Mask email address
Mask string by position
Determine password strength, if it meet all basic password rules such as
- Does password meet the the minimum and maximum length?
- Does password contain numbers?
- Does password contain uppercase letters?
- Does password contain lowercase letters?
- Does password contain special characters?
Deletes files and folders
Write new log line file
Save log a short hand replace parameter in Functions::writeLog
Find log file
Stripes unwanted characters from string and display text in new line in textarea