phpallas/utilities

A comprehensive PHP library of utility functions for simplifying programming tasks, enhancing usability and efficiency across various domains.

1.0.0 2025-04-02 20:34 UTC

This package is auto-updated.

Last update: 2025-04-04 15:18:51 UTC


README

Welcome to PHPallas Utilities! This application is designed to provide a comprehensive set of utility functions that simplify common programming tasks across various domains. Whether you're manipulating arrays, performing mathematical operations, or constructing SQL queries, our library offers a robust solution to enhance your development experience. With a focus on usability and efficiency, PHPallas Utilities aims to empower developers with powerful tools that streamline their workflows and improve productivity.

Features

  • ArrayUtility: Over 60 functions for array manipulation.
  • BooleanUtility: More than 20 functions for handling boolean values.
  • MathUtility: Over 130 functions covering a wide range of mathematical operations.
  • SqlUtility: Functions for constructing SQL queries, including SELECT, UPDATE, DELETE, INSERT, JOIN, and UNION.
  • StringUtility: More than 80 functions for string manipulation.
  • TypesUtility: Over 20 functions for type manipulation, including conversions.

Installation

To install this application, clone the repository and run the following command:

composer require phpallas/utilities

Basic Usage

Here’s a quick example of how to use the utilities:

// Assumed you are using composer autoload

// Example usage of ArrayUtility
$array1 = [
    "name" => [
        "name" => "john",
        "surname" => "doe",
    ]
];
$array2 = [
    "email" => "johndoe@example.com",
    "name" => [
        "midname" => "washington"
    ]
];
$array3 = [
    "country" => "Germany",
    "city" => "Berlin",
];

$result = ArrayUtility::mergeInDepth($array1, $array2, $array3);

/*
$result => [
    "name" => [
        "name" => "john",
        "surname" => "doe",
        "midname" => "washington"
    ],
    "email" => "johndoe@example.com",
    "country" => "Germany",
    "city" => "Berlin",
];
*/

// Example usage of BooleanUtility
$bool = BooleanUtility.fromString("ON");

/*
$bool => true; 
*/

// Example usage of MathUtility

$matrix = [
    [1, 2],
    [3, 4]
];

$result = MathUtility::qrDecompositionMatrix($matrix);

/*
$result => [
    [0.316227766, 0.948683298],
    [0.948683298, -0.316227766]
];
*/

// Example of SqlUtility
$table = "users";
$conditions = ["id", "=", 12];
$sql = SqlUtility::deleteQuery($table, $conditions);

/*
$sql => "DELETE FROM users WHERE id=12;";
*/

// Example of StringUtility
$string = "hello-wORLd";

$result = StringUtility::transformToPascalSnakecase($result);

/*
$result => "Hello_World";
*/

Utilities

Method Description
ArrayUtility
ArrayUtility::create Creates an array of given elements
ArrayUtility::createRandom Creates an array of randon numbers between 1 and 100.
ArrayUtility::createRange Creates an array containing a range of float or integer numericals
ArrayUtility::createByValue Creates an one dimension array of given size includes elements withsimilar value
ArrayUtility::createZeroArray Creates an one dimension array of given size that all elements are zero.
ArrayUtility::createNullArray Createss an one dimension array of given size that all elements are null.
ArrayUtility::createEmpty Creates an empty array
ArrayUtility::createByKeys Creates an array with given keys, all elements have similar value
ArrayUtility::createMatrixArray Creates a two dimension array of given rows and columns that all elementsare equal to given value.
ArrayUtility::createTableArray Creates a two dimension array of given rows and column names that allelements are of equal value.
ArrayUtility::createPairs Creates an array by using the values from the keys array as keys andthe values from the values array as the corresponding values.
ArrayUtility::get Get array items, supporting dot notation
ArrayUtility::getKeys Get all keys of an array
ArrayUtility::getFirstKey Gets the first key of an array
ArrayUtility::getLastKey Gets the last key of an array
ArrayUtility::getFirst Gets the first element of an array
ArrayUtility::getLast Gets the last element of an array
ArrayUtility::getSubset Get a subset of an array by giving keys
ArrayUtility::getColumns Get a subset of two-dimensions array by keys
ArrayUtility::getFiltered Get a subset of array elements using a callback filter function
ArrayUtility::set Set array items, supporting dot notation
ArrayUtility::has Check if an array includes a given value
ArrayUtility::hasKey Checks if the given key or index exists in the array
ArrayUtility::add An acronym to addToEnd()
ArrayUtility::addToEnd Append elements into the end of an array
ArrayUtility::addToStart Prepend elements into the start of an array
ArrayUtility::dropFromStart Drop n first element(s) of an array
ArrayUtility::dropFirst Drop the forst element of an array
ArrayUtility::dropFromEnd Drop n last element(s) of an array
ArrayUtility::dropLast Drops the last element from an array
ArrayUtility::dropKey Drops an element from an array by key, supporting dot notation
ArrayUtility::drop Drops all elements of an array that has a value equal to the given value
ArrayUtility::transform Applies a transform callable to all elements of an array
ArrayUtility::transformToUppercaseKeys Transform the case of all keys in an array to the UPPER_CASE
ArrayUtility::transformToLowercaseKeys Transform the case of all keys in an array to lower_case
ArrayUtility::transformToLowercase Transform all elements of an array to lower_case
ArrayUtility::transformToUppercase Transform all elements of an array to UPPER_CASE
ArrayUtility::transformFlip Exchanges all keys with their associated values in an array
ArrayUtility::isAssociative Checks if an array is associative
ArrayUtility::isEmpty Checks if an array is empty
ArrayUtility::isSameAs Compare two arrays and check if are same
ArrayUtility::isEligibleTo Checks a condition against all element of an array
ArrayUtility::isString Checks if an array elements all are string
ArrayUtility::isBoolean Checks if an array elements all are boolean
ArrayUtility::isCallable Checks if an array elements all are callable
ArrayUtility::isCountable Checks if an array elements all are countable
ArrayUtility::isIterable Checks if an array elements all are iterable
ArrayUtility::isNumeric Checks if an array elements all are numeric
ArrayUtility::isScalar Checks if an array elements all are scalar
ArrayUtility::isFloat Checks if an array elements all are float
ArrayUtility::isNull Checks if an array elements all are null
ArrayUtility::isObject Checks if an array elements all are object
ArrayUtility::isArray Checks if an array elements all are array
ArrayUtility::isInstanceOf Checks if an array elements all are of given class
ArrayUtility::estimateSize Get total number of elements inside an array
ArrayUtility::estimateCounts Get count of distinct values inside an array
ArrayUtility::estimateSum Calculate the sum of values in an array
ArrayUtility::merge Merge one or more arrays
ArrayUtility::mergeInDepth Merge one or more arrays recursively
ArrayUtility::split Split an array into chunks
ArrayUtility::sort Sort elements of an array
ArrayUtility::sortRandom Shuffles (randomizes the order of the elements in) an array.
BooleanUtility Class BooleanUtility
BooleanUtility::fromString Converts a string to a boolean value.
BooleanUtility::toString Converts a boolean value to its string representation.
BooleanUtility::areEqual Checks if two boolean values are equal.
BooleanUtility::isTrue Checks if a boolean is TRUE.
BooleanUtility::isFalse Checks if a boolean is FALSE.
BooleanUtility::not Negates a boolean value.
BooleanUtility::gnot Performs a logical NOT operation on an array of boolean values or a variable number of boolean arguments.
BooleanUtility::and Performs a logical AND operation on two boolean values.
BooleanUtility::gand Performs a logical AND operation on an array of boolean values or a variable number of boolean arguments.
BooleanUtility::nand Performs a logical NAND operation on two boolean values.
BooleanUtility::gnand Performs a logical NAND operation on an array of boolean values or a variable number of boolean arguments.
BooleanUtility::or Performs a logical OR operation on two boolean values.
BooleanUtility::gor Performs a logical OR operation on an array of boolean values or a variable number of boolean arguments.
BooleanUtility::nor Performs a logical NOR operation on two boolean values.
BooleanUtility::gnor Performs a logical NOR operation on an array of boolean values or a variable number of boolean arguments.
BooleanUtility::xor Performs a logical XOR operation on two boolean values.
BooleanUtility::gxor Performs a logical XOR operation on an array of boolean values or a variable number of boolean arguments.
BooleanUtility::xnor Performs a logical XNOR operation on two boolean values.
BooleanUtility::gxnor Performs a logical XNOR operation on an array of boolean values or a variable number of boolean arguments.
BooleanUtility::nxor Alias for xnor
BooleanUtility::xand Alias for xnor
BooleanUtility::gnxor Alias for gxnor
BooleanUtility::gxand Alias for gxnor
DateTime
DateTime::getComponents Summary of toString
DateTime::isLeapSolarHijri Checks if a Solar Hijri year is leap year
MathUtility Class MathUtilityA utility class for common mathematical and physical constants.
MathUtility::round Round to the nearest integer.
MathUtility::floor Floor: Round down to the nearest integer.
MathUtility::ceil Ceil: Round up to the nearest integer.
MathUtility::truncate Truncate: Remove decimal part without rounding.
MathUtility::roundHalfUp Round Half Up.
MathUtility::roundHalfDown Round Half Down.
MathUtility::roundHalfToEven Bankers' Rounding (Round Half to Even).
MathUtility::randomInt Generate a random integer between the given min and max values.
MathUtility::randomFloat Generate a random float between the given min and max values.
MathUtility::estimateSimpleInterest Estimate simple interest.
MathUtility::estimateCompoundInterest Estimate compound interest.
MathUtility::estimateFutureValue Estimate the future value of an investment.
MathUtility::estimatePresentValue Estimate the present value of a future amount.
MathUtility::estimateLoanPayment Estimate monthly loan payment.
MathUtility::estimateTotalPayment Estimate the total amount paid over the life of the loan.
MathUtility::estimateTotalInterest Estimate the total interest paid over the life of the loan.
MathUtility::estimateAPR Estimate the Annual Percentage Rate (APR).
MathUtility::estimateEAR Estimate the Effective Annual Rate (EAR).
MathUtility::generateAmortizationSchedule Generate a loan amortization schedule.
MathUtility::estimateLoanPayoffTime Estimate the loan payoff time in months.
MathUtility::estimateNPV Estimate the Net Present Value (NPV) of cash flows.
MathUtility::compareLoans Compare two loans based on total cost.
MathUtility::addVectors Add two vectors element-wise
MathUtility::subtractVectors Subtract two vectors element-wise
MathUtility::scalarMultiply Multiply vector by scalar
MathUtility::normalize Normalize vector (convert to unit vector)
MathUtility::magnitude Calculate vector magnitude (Euclidean norm)
MathUtility::dotProduct Dot product of two vectors
MathUtility::angleBetween Calculate angle between two vectors in radians
MathUtility::vectorSum Calculate sum of vector elements
MathUtility::vectorAvg Calculate average of vector elements
MathUtility::vectorMin Find minimum value in vector
MathUtility::vectorMax Find maximum value in vector
MathUtility::crossProduct1D 1D cross product (returns scalar value)
MathUtility::projection Project vector A onto vector B
MathUtility::vectorAppend Append value to vector (modifies original vector)
MathUtility::vectorReverse Reverse vector elements
MathUtility::sin Calculates the sine of an angle.
MathUtility::cos Calculates the cosine of an angle.
MathUtility::tan Calculates the tangent of an angle.
MathUtility::asin Calculates the arcsine (inverse sine) of a value.
MathUtility::acos Calculates the arccosine (inverse cosine) of a value.
MathUtility::atan Calculates the arctangent (inverse tangent) of a value.
MathUtility::atan2 Calculates the arctangent of y/x, using the signs of the arguments to determine the quadrant of the result.
MathUtility::sinh Calculates the hyperbolic sine of a value.
MathUtility::cosh Calculates the hyperbolic cosine of a value.
MathUtility::tanh Calculates the hyperbolic tangent of a value.
MathUtility::asinh Calculates the inverse hyperbolic sine of a value.
MathUtility::acosh Calculates the inverse hyperbolic cosine of a value.
MathUtility::atanh Calculates the inverse hyperbolic tangent of a value.
MathUtility::deg2rad Converts an angle from degrees to radians.
MathUtility::rad2deg Converts an angle from radians to degrees.
MathUtility::exponential Calculate the exponential of a number.
MathUtility::naturalLog Calculate the natural logarithm of a number.
MathUtility::logBase10 Calculate the base 10 logarithm of a number.
MathUtility::logBase2 Calculate the base 2 logarithm of a number.
MathUtility::logBase Calculate the logarithm of a number with an arbitrary base.
MathUtility::changeBase Change the base of a logarithm from one base to another.
MathUtility::inverseNaturalLog Calculate the inverse of the natural logarithm.
MathUtility::inverseLogBase10 Calculate the inverse of the base 10 logarithm.
MathUtility::inverseLogBase2 Calculate the inverse of the base 2 logarithm.
MathUtility::exponentialGrowth Calculate exponential growth.
MathUtility::exponentialDecay Calculate exponential decay.
MathUtility::power Calculate the power of a base raised to an exponent.
MathUtility::solveExponentialEquation Solve for x in the equation a^x = b.
MathUtility::logFactorial Calculate the logarithm of a factorial (log(n!)).
MathUtility::addMatrix Add two matrices.
MathUtility::subtractMatrix Subtract two matrices.
MathUtility::multiplyMatrix Multiply two matrices.
MathUtility::inverseMatrix Calculate the inverse of a matrix.
MathUtility::eigenvaluesMatrix Get the eigenvalues of a matrix (simplified for 2x2 matrices).
MathUtility::luDecompositionMatrix Perform LU decomposition of a matrix.
MathUtility::qrDecompositionMatrix Perform QR decomposition of a matrix using Gram-Schmidt process.
MathUtility::subsetMatrix Get a subset of a matrix.
MathUtility::mean Calculate the mean of an array of numbers.
MathUtility::median Calculate the median of an array of numbers.
MathUtility::mode Calculate the mode of an array of numbers.
MathUtility::variance Calculate the sample variance of an array of numbers.
MathUtility::populationVariance Calculate the population variance of an array of numbers.
MathUtility::standardDeviation Calculate the sample standard deviation of an array of numbers.
MathUtility::populationStandardDeviation Calculate the population standard deviation of an array of numbers.
MathUtility::correlation Calculate the correlation coefficient between two variables.
MathUtility::multipleLinearRegression Perform multiple linear regression to calculate coefficients.
MathUtility::normalDistributionPDF Calculate the normal distribution PDF.
MathUtility::normalDistributionCDF Calculate the normal distribution CDF.
MathUtility::binomialProbability Calculate the binomial probability.
MathUtility::poissonDistribution Calculate the Poisson distribution PDF.
MathUtility::exponentialDistributionPDF Calculate the exponential distribution PDF.
MathUtility::exponentialDistributionCDF Calculate the exponential distribution CDF.
MathUtility::uniformDistributionPDF Calculate the uniform distribution PDF.
MathUtility::uniformDistributionCDF Calculate the uniform distribution CDF.
MathUtility::skewness Calculate the sample skewness of an array of numbers.
MathUtility::kurtosis Calculate the sample kurtosis of an array of numbers.
MathUtility::gcd Calculate the greatest common divisor (GCD) of two numbers.
MathUtility::lcm Calculate the least common multiple (LCM) of two numbers.
MathUtility::isPrime Check if a number is prime.
MathUtility::generatePrimes Generate a list of prime numbers up to a given limit.
MathUtility::fibonacci Calculate the Fibonacci number at a given position.
MathUtility::isPerfectSquare Check if a number is a perfect square.
MathUtility::primeFactorization Find the prime factorization of a number.
MathUtility::sumOfDivisors Calculate the sum of divisors of a number.
MathUtility::eulerTotient Calculate Euler's Totient function for a given number.
MathUtility::areCoprime Check if two numbers are coprime (i.e., their GCD is 1).
MathUtility::generatePerfectNumbers Generate a list of perfect numbers up to a given limit.
MathUtility::differentiate
MathUtility::integrate
MathUtility::evaluate
MathUtility::findQuadraticRoots
MathUtility::limit
MathUtility::taylorSeries
MathUtility::numericalIntegration
MathUtility::partialDerivative
MathUtility::gradient
MathUtility::secondDerivative
MathUtility::findLocalExtrema
MathUtility::areaUnderCurve
MathUtility::areaOfCircle Calculate the area of a circle.
MathUtility::circumferenceOfCircle Calculate the circumference of a circle.
MathUtility::areaOfRectangle Calculate the area of a rectangle.
MathUtility::perimeterOfRectangle Calculate the perimeter of a rectangle.
MathUtility::areaOfTriangle Calculate the area of a triangle.
MathUtility::perimeterOfTriangle Calculate the perimeter of a triangle (assuming it's a right triangle).
MathUtility::areaOfSquare Calculate the area of a square.
MathUtility::perimeterOfSquare Calculate the perimeter of a square.
MathUtility::volumeOfCube Calculate the volume of a cube.
MathUtility::surfaceAreaOfCube Calculate the surface area of a cube.
MathUtility::volumeOfRectangularPrism Calculate the volume of a rectangular prism.
MathUtility::surfaceAreaOfRectangularPrism Calculate the surface area of a rectangular prism.
MathUtility::areaOfTrapezoid Calculate the area of a trapezoid.
MathUtility::areaOfParallelogram Calculate the area of a parallelogram.
MathUtility::areaOfEllipse Calculate the area of an ellipse.
MathUtility::circumferenceOfEllipse Calculate the circumference of an ellipse (approximation).
PHP
PHP::version Get PHP version
PHP::versionID Get PHP version as a number
PHP::versionMajor Get PHP major version
PHP::versionMinor Get PHP minor Version
PHP::versionRelease Get PHP release version
Polyfill
Polyfill::mb_str_pad
Polyfill::mb_strlen
Polyfill::mb_internal_encoding
Polyfill::iconv
Polyfill::mb_split
Polyfill::mb_str_split
Polyfill::mb_substr
Polyfill::mb_trim
Polyfill::mb_ltrim
Polyfill::mb_rtrim
Polyfill::mb_strpos
Polyfill::mb_strrev
Polyfill::mb_str_shuffle
Polyfill::chr
Polyfill::polyfill_mb_detect_encoding
Polyfill::mb_detect_encoding
Polyfill::mb_detect_order
Polyfill::ord
Polyfill::mb_ord
Polyfill::str_contains
Polyfill::str_starts_with
Polyfill::str_ends_with
Polyfill::mb_chr
Polyfill::mb_convert_encoding
Polyfill::mb_check_encoding
Polyfill::password_verify
Polyfill::password_hash
SqlUtility
SqlUtility::selectQuery selectQuery is a versatile function that dynamically builds a SQL SELECTstatement based on the provided parameters. It handles various SQL syntaxdifferences across multiple database systems, ensuring that the correctsyntax is used for limiting results, grouping, ordering, and filteringdata. The method is designed to be flexible and reusable for differentdatabase interactions.
SqlUtility::updateQuery The updateQuery method is a flexible function that constructs a SQLUPDATE statement dynamically based on the provided parameters. It handlesthe creation of the SET and WHERE clauses, ensuring proper parameterbinding to prevent SQL injection. This method is designed to be reusablefor updating rows in different tables with varying conditions.
SqlUtility::deleteQuery The deleteQuery method is a straightforward function that constructs aSQL DELETE statement dynamically based on the provided parameters. Itbuilds the WHERE clause to specify which rows to delete, ensuring properparameter binding to prevent SQL injection. This method is designed to bereusable for deleting records from different tables based on variousconditions.
SqlUtility::insertQuery This function is designed to handle both single-row and multi-rowinserts into a database table. It dynamically constructs the SQL queryand ensures that parameter names are unique to prevent conflicts duringexecution.
SqlUtility::unionQuery
SqlUtility::buildOrderClause
SqlUtility::buildWhereClause
StringUtility Class StringUtility
StringUtility::create Creates a string consisting of a specified character repeated to a givenlength.
StringUtility::createRandom Generates a random string of a specified length using the providedcharacters.
StringUtility::createByRepeat Repeats a given string a specified number of times.
StringUtility::get Retrieves a character from a string at a specified index.
StringUtility::getSubset Retrieves a subset of a string starting from a given index.
StringUtility::getSegment Retrieves a segment of a string between two specified indices.
StringUtility::set Sets a character at a specified index in the given string.
StringUtility::setReplace Replaces occurrences of a substring within a string.
StringUtility::setInStart Pads the string on the left with a specified character to a given length.
StringUtility::setInEnd Pads the string on the right with a specified character to a given length.
StringUtility::hasPhrase Checks if a specified phrase exists within a given string.
StringUtility::addToStart Adds a specified value to the start of the given string.
StringUtility::addToEnd Adds a specified value to the end of the given string.
StringUtility::addToCenter Adds a specified value to the center of the given string.
StringUtility::addEvenly Adds a specified value evenly throughout the given string.
StringUtility::drop Drops specified characters from the given string.
StringUtility::dropFirst Drops the first character from the given string.
StringUtility::dropLast Drops the last character from the given string.
StringUtility::dropNth Drops the character at the specified index from the given string.
StringUtility::dropFromSides Drops specified characters from both ends of the given string.
StringUtility::dropFromStart Drops specified characters from the start of the given string.
StringUtility::dropFromEnd Drops specified characters from the end of the given string.
StringUtility::dropSeparator Drops specified separators from the given string.
StringUtility::dropSpace Drops all spaces from the given string.
StringUtility::dropExtras Truncates a string to a specified length and appends ellipsis if needed.
StringUtility::transformToReverse Transforms the given string to its reverse.
StringUtility::transformToShuffle Transforms the given string by shuffling its characters.
StringUtility::transformToNoTag Transforms the given string by stripping HTML and PHP tags.
StringUtility::transformToLowercase Transforms the given string to lowercase.
StringUtility::transformToUppercase Transforms the given string to uppercase.
StringUtility::transformToLowercaseFirst Transforms the given string to lowercase, capitalizing the first character.
StringUtility::transformToUppercaseFirst Transforms the given string to uppercase, capitalizing the first character.
StringUtility::transformToCapital Capitalizes the first letter of each word in the string.
StringUtility::transformToFlatcase Transforms the given string to flatcase.
StringUtility::transformToPascalCase Transforms the given string to PascalCase.
StringUtility::transformToCamelcase Transforms the given string to camelCase.
StringUtility::transformToSnakecase Transforms the given string to snake_case.
StringUtility::transformToMacrocase Transforms the given string to MACROCASE.
StringUtility::transformToPascalSnakecase Transforms the given string to Pascal_Snake_Case.
StringUtility::transformToCamelSnakecase Transforms the given string to camel_snake_case.
StringUtility::transformToKebabcase Transforms the given string to kebab-case.
StringUtility::transformToCobolcase Transforms the given string to COBOLCASE.
StringUtility::transformToTraincase Transforms the given string to train-case.
StringUtility::transformToMetaphone Transforms the given string to its metaphone representation.
StringUtility::transformToSoundex Transforms the given string to its soundex representation.
StringUtility::isEqualTo Checks if two strings are equal.
StringUtility::isSameAs Checks if two strings are equal, ignoring case.
StringUtility::isStartedBy Checks if a string starts with a given substring.
StringUtility::isEndedWith Checks if a string ends with a given substring.
StringUtility::isPalindrome Checks if a string is a palindrome.
StringUtility::estimateLength Estimates the length of a string.
StringUtility::estimateCounts Estimates the counts of each character in a string.
StringUtility::estimateSimilarity Compares two strings and returns a similarity score.
StringUtility::merge Merges multiple strings into a single string using a specified separator.
StringUtility::split Splits a string into segments of specified length.
StringUtility::splitBy Splits a string by a specified separator.
StringUtility::toHex Converts a string to its hexadecimal representation.
StringUtility::fromHex Converts a hexadecimal string back to its original form.
StringUtility::toAscii Converts a character to its ASCII value.
StringUtility::fromAscii Converts an ASCII value back to its corresponding character.
StringUtility::toFormat Formats values into a string according to a specified format.
StringUtility::fromFormat Parses a string according to a specified format.
StringUtility::toArray Converts a string into an array of its characters.
StringUtility::toArrayWithSeparator Converts a string into an array using a custom separator.
StringUtility::fromArray Converts an array of strings back into a single string.
StringUtility::toInteger Converts a string to an integer.
StringUtility::fromInteger Converts an integer back to a string.
StringUtility::toFloat Converts a string to a float.
StringUtility::fromFloat Converts a float back to a string.
StringUtility::toBoolean Converts a string to a boolean value.
StringUtility::fromBoolean Converts a boolean value to its string representation.
StringUtility::inRot Encodes a string using ROT13.
StringUtility::ofRot Decodes a string using ROT13.
StringUtility::inSlashes Escapes special characters in a string using slashes.
StringUtility::ofSlashes Unescapes special characters in a string.
StringUtility::inUU Encodes a string using UU encoding.
StringUtility::ofUU Decodes a UU encoded string.
StringUtility::inSafeCharacters Converts special characters to HTML entities.
StringUtility::ofSafeCharacters Converts HTML entities back to their corresponding characters.
StringUtility::inHtmlEntities Converts special characters to HTML entities with quotes.
StringUtility::ofHtmlEntities Converts HTML entities back to their corresponding characters with quotes.
StringUtility::hashMD5 Generates an MD5 hash of a given string.
StringUtility::hashSHA Generates a SHA-1 hash of a given string.
StringUtility::hashChecksum Generates a checksum for a given string using SHA-1.
StringUtility::validateChecksum Validates a given string against a provided checksum.
TypesUtility Class TypesUtility
TypesUtility::getType Get the type of a variable.
TypesUtility::isArray Check if the variable is an array.
TypesUtility::isBoolean Check if the variable is a boolean.
TypesUtility::isCallable Check if the variable is callable.
TypesUtility::isCountable Check if the variable is countable.
TypesUtility::isFloat Check if the variable is a float.
TypesUtility::isInteger Check if the variable is an integer.
TypesUtility::isIterable Check if the variable is iterable.
TypesUtility::isNull Check if the variable is null.
TypesUtility::isNumeric Check if the variable is numeric.
TypesUtility::isObject Check if the variable is an object.
TypesUtility::isResource Check if the variable is a resource.
TypesUtility::isScalar Check if the variable is a scalar.
TypesUtility::isString Check if the variable is a string.
TypesUtility::to Convert a variable to a specified target type.
TypesUtility::toString Convert a variable to a string.
TypesUtility::toInteger Convert a variable to an integer.
TypesUtility::toFloat Convert a variable to a float.
TypesUtility::toBoolean Convert a variable to a boolean.
TypesUtility::toArray Convert a variable to an array.
TypesUtility::toObject Convert a variable to an object.

ArrayUtility

  • Full name: \PHPallas\Utilities\ArrayUtility

ArrayUtility::create

Creates an array of given elements

ArrayUtility::create(  ): array
  • This method is static.

Return Value:

ArrayUtility::createRandom

Creates an array of randon numbers between 1 and 100.

ArrayUtility::createRandom( int size ): int[]
  • This method is static. Parameters:
Parameter Type Description
size int Length of array

Return Value:

ArrayUtility::createRange

Creates an array containing a range of float or integer numericals

ArrayUtility::createRange( float|int min, float|int max, float|int step = 1 ): array
  • This method is static. Parameters:
Parameter Type Description
min float|int The minimum value in the array
max float|int The maximum value in the array
step float|int Indicates by how much is the produced sequence
progressed between values of the sequence. step may be negative for
decreasing sequences

Return Value:

ArrayUtility::createByValue

Creates an one dimension array of given size includes elements with similar value

ArrayUtility::createByValue( int size, mixed value ): array
  • This method is static. Parameters:
Parameter Type Description
size int Count of array elements
value mixed value of array elements

Return Value:

ArrayUtility::createZeroArray

Creates an one dimension array of given size that all elements are zero.

ArrayUtility::createZeroArray( int size ): array
  • This method is static. Parameters:
Parameter Type Description
size int

Return Value:

ArrayUtility::createNullArray

Createss an one dimension array of given size that all elements are null.

ArrayUtility::createNullArray( int size ): array
  • This method is static. Parameters:
Parameter Type Description
size int

Return Value:

ArrayUtility::createEmpty

Creates an empty array

ArrayUtility::createEmpty(  ): array
  • This method is static.

Return Value:

ArrayUtility::createByKeys

Creates an array with given keys, all elements have similar value

ArrayUtility::createByKeys( array keys, mixed value ): array
  • This method is static. Parameters:
Parameter Type Description
keys array
value mixed

Return Value:

ArrayUtility::createMatrixArray

Creates a two dimension array of given rows and columns that all elements are equal to given value.

ArrayUtility::createMatrixArray( int columnsCount, int rowsCount, mixed value ): array
  • This method is static. Parameters:
Parameter Type Description
columnsCount int Number of matrix columns
rowsCount int Number of matrix rows
value mixed Value of matrix elements

Return Value:

ArrayUtility::createTableArray

Creates a two dimension array of given rows and column names that all elements are of equal value.

ArrayUtility::createTableArray( array columns, int rowsCount, mixed value ): array
  • This method is static. Parameters:
Parameter Type Description
columns array An array of table head keys
rowsCount int Number of rows
value mixed Value of cells

Return Value:

ArrayUtility::createPairs

Creates an array by using the values from the keys array as keys and the values from the values array as the corresponding values.

ArrayUtility::createPairs( array keys, array values ): array
  • This method is static. Parameters:
Parameter Type Description
keys array
values array

Return Value:

ArrayUtility::get

Get array items, supporting dot notation

ArrayUtility::get( array &array, string path, mixed default = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
array array
path string
default mixed

Return Value:

ArrayUtility::getKeys

Get all keys of an array

ArrayUtility::getKeys( array array ): array
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::getFirstKey

Gets the first key of an array

ArrayUtility::getFirstKey( array array ): mixed
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::getLastKey

Gets the last key of an array

ArrayUtility::getLastKey( array array ): mixed
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::getFirst

Gets the first element of an array

ArrayUtility::getFirst( array array ): mixed
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::getLast

Gets the last element of an array

ArrayUtility::getLast( array array ): mixed
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::getSubset

Get a subset of an array by giving keys

ArrayUtility::getSubset( array array, array keys ): array
  • This method is static. Parameters:
Parameter Type Description
array array
keys array

Return Value:

ArrayUtility::getColumns

Get a subset of two-dimensions array by keys

ArrayUtility::getColumns( array array, array columns ): array
  • This method is static. Parameters:
Parameter Type Description
array array
columns array

Return Value:

ArrayUtility::getFiltered

Get a subset of array elements using a callback filter function

ArrayUtility::getFiltered( array array, callable function ): array
  • This method is static. Parameters:
Parameter Type Description
array array
function callable

Return Value:

ArrayUtility::set

Set array items, supporting dot notation

ArrayUtility::set( array &array, string path, mixed value ): mixed
  • This method is static. Parameters:
Parameter Type Description
array array
path string
value mixed

Return Value:

ArrayUtility::has

Check if an array includes a given value

ArrayUtility::has( array array, mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
array array
value mixed

Return Value:

ArrayUtility::hasKey

Checks if the given key or index exists in the array

ArrayUtility::hasKey( array array, int|string key ): bool
  • This method is static. Parameters:
Parameter Type Description
array array
key int|string

Return Value:

ArrayUtility::add

An acronym to addToEnd()

ArrayUtility::add(  ): array
  • This method is static.

Return Value:

ArrayUtility::addToEnd

Append elements into the end of an array

ArrayUtility::addToEnd( array array ): array
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::addToStart

Prepend elements into the start of an array

ArrayUtility::addToStart( array array ): array
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::dropFromStart

Drop n first element(s) of an array

ArrayUtility::dropFromStart( array array, int count = 1 ): array
  • This method is static. Parameters:
Parameter Type Description
array array
count int

Return Value:

ArrayUtility::dropFirst

Drop the forst element of an array

ArrayUtility::dropFirst( array array ): array
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::dropFromEnd

Drop n last element(s) of an array

ArrayUtility::dropFromEnd( array array, int count = 1 ): array
  • This method is static. Parameters:
Parameter Type Description
array array
count int

Return Value:

ArrayUtility::dropLast

Drops the last element from an array

ArrayUtility::dropLast( array array ): array
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::dropKey

Drops an element from an array by key, supporting dot notation

ArrayUtility::dropKey( array &array, mixed key, bool reIndex = true ): array
  • This method is static. Parameters:
Parameter Type Description
array array
key mixed
reIndex bool

Return Value:

ArrayUtility::drop

Drops all elements of an array that has a value equal to the given value

ArrayUtility::drop( array array, mixed value, bool reIndex = true ): array
  • This method is static. Parameters:
Parameter Type Description
array array
value mixed
reIndex bool

Return Value:

ArrayUtility::transform

Applies a transform callable to all elements of an array

ArrayUtility::transform( array array, callable function ): array
  • This method is static. Parameters:
Parameter Type Description
array array
function callable

Return Value:

ArrayUtility::transformToUppercaseKeys

Transform the case of all keys in an array to the UPPER_CASE

ArrayUtility::transformToUppercaseKeys( mixed array ): array
  • This method is static. Parameters:
Parameter Type Description
array mixed

Return Value:

ArrayUtility::transformToLowercaseKeys

Transform the case of all keys in an array to lower_case

ArrayUtility::transformToLowercaseKeys( mixed array ): array
  • This method is static. Parameters:
Parameter Type Description
array mixed

Return Value:

ArrayUtility::transformToLowercase

Transform all elements of an array to lower_case

ArrayUtility::transformToLowercase( array array ): array
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::transformToUppercase

Transform all elements of an array to UPPER_CASE

ArrayUtility::transformToUppercase( array array ): array
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::transformFlip

Exchanges all keys with their associated values in an array

ArrayUtility::transformFlip( array array ): array
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isAssociative

Checks if an array is associative

ArrayUtility::isAssociative( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isEmpty

Checks if an array is empty

ArrayUtility::isEmpty( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isSameAs

Compare two arrays and check if are same

ArrayUtility::isSameAs( array array1, array array2, bool strict = false ): bool
  • This method is static. Parameters:
Parameter Type Description
array1 array
array2 array
strict bool

Return Value:

ArrayUtility::isEligibleTo

Checks a condition against all element of an array

ArrayUtility::isEligibleTo( array array, callable function ): bool
  • This method is static. Parameters:
Parameter Type Description
array array
function callable

Return Value:

ArrayUtility::isString

Checks if an array elements all are string

ArrayUtility::isString( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isBoolean

Checks if an array elements all are boolean

ArrayUtility::isBoolean( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isCallable

Checks if an array elements all are callable

ArrayUtility::isCallable( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isCountable

Checks if an array elements all are countable

ArrayUtility::isCountable( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isIterable

Checks if an array elements all are iterable

ArrayUtility::isIterable( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isNumeric

Checks if an array elements all are numeric

ArrayUtility::isNumeric( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isScalar

Checks if an array elements all are scalar

ArrayUtility::isScalar( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isFloat

Checks if an array elements all are float

ArrayUtility::isFloat( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isNull

Checks if an array elements all are null

ArrayUtility::isNull( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isObject

Checks if an array elements all are object

ArrayUtility::isObject( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isArray

Checks if an array elements all are array

ArrayUtility::isArray( array array ): bool
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::isInstanceOf

Checks if an array elements all are of given class

ArrayUtility::isInstanceOf( array array, mixed class ): bool
  • This method is static. Parameters:
Parameter Type Description
array array
class mixed

Return Value:

ArrayUtility::estimateSize

Get total number of elements inside an array

ArrayUtility::estimateSize( array array ): int
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::estimateCounts

Get count of distinct values inside an array

ArrayUtility::estimateCounts( array array ): int[]
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::estimateSum

Calculate the sum of values in an array

ArrayUtility::estimateSum( array array ): float|int
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

ArrayUtility::merge

Merge one or more arrays

ArrayUtility::merge(  ): array
  • This method is static.

Return Value:

ArrayUtility::mergeInDepth

Merge one or more arrays recursively

ArrayUtility::mergeInDepth(  ): array
  • This method is static.

Return Value:

ArrayUtility::split

Split an array into chunks

ArrayUtility::split( array array, int size, bool isAssoc = false ): array
  • This method is static. Parameters:
Parameter Type Description
array array
size int
isAssoc bool

Return Value:

ArrayUtility::sort

Sort elements of an array

ArrayUtility::sort( array array, mixed sortByKeys = false, mixed descending = false, mixed isAssoc = false ): array
  • This method is static. Parameters:
Parameter Type Description
array array
sortByKeys mixed
descending mixed
isAssoc mixed

Return Value:

ArrayUtility::sortRandom

Shuffles (randomizes the order of the elements in) an array.

ArrayUtility::sortRandom( array array ): array
  • This method is static. Parameters:
Parameter Type Description
array array

Return Value:

BooleanUtility

Class BooleanUtility

A utility class providing methods for boolean manipulations, including a set of immutable constants for commonly used boolean values.

  • Full name: \PHPallas\Utilities\BooleanUtility

BooleanUtility::fromString

Converts a string to a boolean value.

BooleanUtility::fromString( string string ): bool

This method interprets specific string values as true or false. Recognized true values include: "true", "1", "yes", "on". Recognized false values include: "false", "0", "no", "off".

  • This method is static. Parameters:
Parameter Type Description
string string The input string to convert.

Return Value:

The boolean value represented by the string.

BooleanUtility::toString

Converts a boolean value to its string representation.

BooleanUtility::toString( bool boolean ): string

This method returns "true" or "false" based on the boolean value.

  • This method is static. Parameters:
Parameter Type Description
boolean bool The boolean value to convert.

Return Value:

"true" or "false" based on the boolean value.

BooleanUtility::areEqual

Checks if two boolean values are equal.

BooleanUtility::areEqual( bool boolean1, bool boolean2 ): bool
  • This method is static. Parameters:
Parameter Type Description
boolean1 bool The first boolean to compare.
boolean2 bool The second boolean to compare.

Return Value:

Returns true if both booleans are equal, false otherwise.

BooleanUtility::isTrue

Checks if a boolean is TRUE.

BooleanUtility::isTrue( bool boolean ): bool
  • This method is static. Parameters:
Parameter Type Description
boolean bool The boolean to check.

Return Value:

Returns true if both booleans are equal, false otherwise.

BooleanUtility::isFalse

Checks if a boolean is FALSE.

BooleanUtility::isFalse( bool boolean ): bool
  • This method is static. Parameters:
Parameter Type Description
boolean bool The boolean to check.

Return Value:

Returns true if both booleans are equal, false otherwise.

BooleanUtility::not

Negates a boolean value.

BooleanUtility::not( bool boolean ): bool

This method returns the opposite of the provided boolean value.

  • This method is static. Parameters:
Parameter Type Description
boolean bool The boolean value to negate.

Return Value:

The negated boolean value.

BooleanUtility::gnot

Performs a logical NOT operation on an array of boolean values or a variable number of boolean arguments.

BooleanUtility::gnot( mixed booleans ): array

This function negates each boolean value in the input array or the provided arguments and returns an array of the results.

  • This method is static. Parameters:
Parameter Type Description
booleans mixed Either an array of boolean values or a list of boolean arguments.

Return Value:

An array containing the negated boolean values.

BooleanUtility::and

Performs a logical AND operation on two boolean values.

BooleanUtility::and( bool boolean1, bool boolean2 ): bool
  • This method is static. Parameters:
Parameter Type Description
boolean1 bool The first boolean value.
boolean2 bool The second boolean value.

Return Value:

The result of the logical AND operation.

BooleanUtility::gand

Performs a logical AND operation on an array of boolean values or a variable number of boolean arguments.

BooleanUtility::gand( mixed booleans ): bool
  • This method is static. Parameters:
Parameter Type Description
booleans mixed Either an array of boolean values or a list of boolean arguments.

Return Value:

The result of the logical AND operation.

BooleanUtility::nand

Performs a logical NAND operation on two boolean values.

BooleanUtility::nand( bool boolean1, bool boolean2 ): bool
  • This method is static. Parameters:
Parameter Type Description
boolean1 bool The first boolean value.
boolean2 bool The second boolean value.

Return Value:

The result of the logical NAND operation.

BooleanUtility::gnand

Performs a logical NAND operation on an array of boolean values or a variable number of boolean arguments.

BooleanUtility::gnand( mixed booleans ): bool
  • This method is static. Parameters:
Parameter Type Description
booleans mixed Either an array of boolean values or a list of boolean arguments.

Return Value:

The result of the logical NAND operation.

BooleanUtility::or

Performs a logical OR operation on two boolean values.

BooleanUtility::or( bool boolean1, bool boolean2 ): bool
  • This method is static. Parameters:
Parameter Type Description
boolean1 bool The first boolean value.
boolean2 bool The second boolean value.

Return Value:

The result of the logical OR operation.

BooleanUtility::gor

Performs a logical OR operation on an array of boolean values or a variable number of boolean arguments.

BooleanUtility::gor( mixed booleans ): bool
  • This method is static. Parameters:
Parameter Type Description
booleans mixed Either an array of boolean values or a list of boolean arguments.

Return Value:

The result of the logical OR operation.

BooleanUtility::nor

Performs a logical NOR operation on two boolean values.

BooleanUtility::nor( bool boolean1, bool boolean2 ): bool
  • This method is static. Parameters:
Parameter Type Description
boolean1 bool The first boolean value.
boolean2 bool The second boolean value.

Return Value:

The result of the logical NOR operation.

BooleanUtility::gnor

Performs a logical NOR operation on an array of boolean values or a variable number of boolean arguments.

BooleanUtility::gnor( mixed booleans ): bool
  • This method is static. Parameters:
Parameter Type Description
booleans mixed Either an array of boolean values or a list of boolean arguments.

Return Value:

The result of the logical NOR operation.

BooleanUtility::xor

Performs a logical XOR operation on two boolean values.

BooleanUtility::xor( bool boolean1, bool boolean2 ): bool
  • This method is static. Parameters:
Parameter Type Description
boolean1 bool The first boolean value.
boolean2 bool The second boolean value.

Return Value:

The result of the logical XOR operation.

BooleanUtility::gxor

Performs a logical XOR operation on an array of boolean values or a variable number of boolean arguments.

BooleanUtility::gxor( mixed booleans ): bool
  • This method is static. Parameters:
Parameter Type Description
booleans mixed Either an array of boolean values or a list of boolean arguments.

Return Value:

The result of the logical XOR operation.

BooleanUtility::xnor

Performs a logical XNOR operation on two boolean values.

BooleanUtility::xnor( bool boolean1, bool boolean2 ): bool
  • This method is static. Parameters:
Parameter Type Description
boolean1 bool The first boolean value.
boolean2 bool The second boolean value.

Return Value:

The result of the logical XNOR operation.

BooleanUtility::gxnor

Performs a logical XNOR operation on an array of boolean values or a variable number of boolean arguments.

BooleanUtility::gxnor( mixed booleans ): bool
  • This method is static. Parameters:
Parameter Type Description
booleans mixed Either an array of boolean values or a list of boolean arguments.

Return Value:

The result of the logical XNOR operation.

BooleanUtility::nxor

Alias for xnor

BooleanUtility::nxor( mixed boolean1, mixed boolean2 ): mixed
  • This method is static. Parameters:
Parameter Type Description
boolean1 mixed
boolean2 mixed

Return Value:

BooleanUtility::xand

Alias for xnor

BooleanUtility::xand( mixed boolean1, mixed boolean2 ): mixed
  • This method is static. Parameters:
Parameter Type Description
boolean1 mixed
boolean2 mixed

Return Value:

BooleanUtility::gnxor

Alias for gxnor

BooleanUtility::gnxor( mixed booleans ): mixed
  • This method is static. Parameters:
Parameter Type Description
booleans mixed

Return Value:

BooleanUtility::gxand

Alias for gxnor

BooleanUtility::gxand( mixed boolean ): mixed
  • This method is static. Parameters:
Parameter Type Description
boolean mixed

Return Value:

DateTime

  • Full name: \PHPallas\Utilities\DateTime

DateTime::getComponents

Summary of toString

DateTime::getComponents( int timestamp, int calendar ): array
  • This method is static. Parameters:
Parameter Type Description
timestamp int
calendar int

Return Value:

DateTime::isLeapSolarHijri

Checks if a Solar Hijri year is leap year

DateTime::isLeapSolarHijri( mixed year ): bool
  • This method is static. Parameters:
Parameter Type Description
year mixed

Return Value:

MathUtility

Class MathUtility A utility class for common mathematical and physical constants.

  • Full name: \PHPallas\Utilities\MathUtility

MathUtility::round

Round to the nearest integer.

MathUtility::round( float number ): int
  • This method is static. Parameters:
Parameter Type Description
number float The number to round.

Return Value:

The rounded integer.

MathUtility::floor

Floor: Round down to the nearest integer.

MathUtility::floor( float number ): int
  • This method is static. Parameters:
Parameter Type Description
number float The number to floor.

Return Value:

The floored integer.

MathUtility::ceil

Ceil: Round up to the nearest integer.

MathUtility::ceil( float number ): int
  • This method is static. Parameters:
Parameter Type Description
number float The number to ceil.

Return Value:

The ceiled integer.

MathUtility::truncate

Truncate: Remove decimal part without rounding.

MathUtility::truncate( float number ): int
  • This method is static. Parameters:
Parameter Type Description
number float The number to truncate.

Return Value:

The truncated integer.

MathUtility::roundHalfUp

Round Half Up.

MathUtility::roundHalfUp( float number ): int
  • This method is static. Parameters:
Parameter Type Description
number float The number to round.

Return Value:

The rounded integer.

MathUtility::roundHalfDown

Round Half Down.

MathUtility::roundHalfDown( float number ): int
  • This method is static. Parameters:
Parameter Type Description
number float The number to round.

Return Value:

The rounded integer.

MathUtility::roundHalfToEven

Bankers' Rounding (Round Half to Even).

MathUtility::roundHalfToEven( float number ): int
  • This method is static. Parameters:
Parameter Type Description
number float The number to round.

Return Value:

The rounded integer.

MathUtility::randomInt

Generate a random integer between the given min and max values.

MathUtility::randomInt( int min, int max ): int
  • This method is static. Parameters:
Parameter Type Description
min int The minimum value (inclusive).
max int The maximum value (inclusive).

Return Value:

A random integer between min and max.

MathUtility::randomFloat

Generate a random float between the given min and max values.

MathUtility::randomFloat( float min, float max ): float
  • This method is static. Parameters:
Parameter Type Description
min float The minimum value (inclusive).
max float The maximum value (inclusive).

Return Value:

A random float between min and max.

MathUtility::estimateSimpleInterest

Estimate simple interest.

MathUtility::estimateSimpleInterest( float principal, float rate, int time ): float
  • This method is static. Parameters:
Parameter Type Description
principal float The principal amount.
rate float The annual interest rate (as a decimal).
time int The time in years.

Return Value:

The estimated simple interest.

MathUtility::estimateCompoundInterest

Estimate compound interest.

MathUtility::estimateCompoundInterest( float principal, float rate, int time, int n ): float
  • This method is static. Parameters:
Parameter Type Description
principal float The principal amount.
rate float The annual interest rate (as a decimal).
time int The time in years.
n int The number of times interest is compounded per year.

Return Value:

The estimated compound interest.

MathUtility::estimateFutureValue

Estimate the future value of an investment.

MathUtility::estimateFutureValue( float principal, float rate, int time ): float
  • This method is static. Parameters:
Parameter Type Description
principal float The principal amount.
rate float The annual interest rate (as a decimal).
time int The time in years.

Return Value:

The estimated future value.

MathUtility::estimatePresentValue

Estimate the present value of a future amount.

MathUtility::estimatePresentValue( float futureValue, float rate, int time ): float
  • This method is static. Parameters:
Parameter Type Description
futureValue float The future amount.
rate float The annual interest rate (as a decimal).
time int The time in years.

Return Value:

The estimated present value.

MathUtility::estimateLoanPayment

Estimate monthly loan payment.

MathUtility::estimateLoanPayment( float principal, float annualRate, int months ): float
  • This method is static. Parameters:
Parameter Type Description
principal float The loan amount.
annualRate float The annual interest rate (as a decimal).
months int The number of months to pay off the loan.

Return Value:

The estimated monthly payment.

MathUtility::estimateTotalPayment

Estimate the total amount paid over the life of the loan.

MathUtility::estimateTotalPayment( float monthlyPayment, int months ): float
  • This method is static. Parameters:
Parameter Type Description
monthlyPayment float The monthly payment amount.
months int The number of months to pay off the loan.

Return Value:

The estimated total amount paid.

MathUtility::estimateTotalInterest

Estimate the total interest paid over the life of the loan.

MathUtility::estimateTotalInterest( float totalPayment, float principal ): float
  • This method is static. Parameters:
Parameter Type Description
totalPayment float The total amount paid.
principal float The loan amount.

Return Value:

The estimated total interest paid.

MathUtility::estimateAPR

Estimate the Annual Percentage Rate (APR).

MathUtility::estimateAPR( float interest, float principal, int months ): float
  • This method is static. Parameters:
Parameter Type Description
interest float The total interest paid.
principal float The loan amount.
months int The number of months.

Return Value:

The estimated APR as a decimal.

MathUtility::estimateEAR

Estimate the Effective Annual Rate (EAR).

MathUtility::estimateEAR( float nominalRate, int n ): float
  • This method is static. Parameters:
Parameter Type Description
nominalRate float The nominal interest rate (as a decimal).
n int The number of compounding periods per year.

Return Value:

The estimated EAR as a decimal.

MathUtility::generateAmortizationSchedule

Generate a loan amortization schedule.

MathUtility::generateAmortizationSchedule( float principal, float annualRate, int months ): array
  • This method is static. Parameters:
Parameter Type Description
principal float The loan amount.
annualRate float The annual interest rate (as a decimal).
months int The number of months to pay off the loan.

Return Value:

The amortization schedule.

MathUtility::estimateLoanPayoffTime

Estimate the loan payoff time in months.

MathUtility::estimateLoanPayoffTime( float principal, float monthlyPayment, float annualRate ): int
  • This method is static. Parameters:
Parameter Type Description
principal float The loan amount.
monthlyPayment float The monthly payment amount.
annualRate float The annual interest rate (as a decimal).

Return Value:

The estimated number of months to pay off the loan.

MathUtility::estimateNPV

Estimate the Net Present Value (NPV) of cash flows.

MathUtility::estimateNPV( array cashFlows, float rate ): float
  • This method is static. Parameters:
Parameter Type Description
cashFlows array An array of cash flows (positive and negative).
rate float The discount rate (as a decimal).

Return Value:

The estimated NPV.

MathUtility::compareLoans

Compare two loans based on total cost.

MathUtility::compareLoans( float principal1, float annualRate1, int months1, float principal2, float annualRate2, int months2 ): string
  • This method is static. Parameters:
Parameter Type Description
principal1 float The first loan amount.
annualRate1 float The first loan annual interest rate (as a decimal).
months1 int The first loan term in months.
principal2 float The second loan amount.
annualRate2 float The second loan annual interest rate (as a decimal).
months2 int The second loan term in months.

Return Value:

Comparison result.

MathUtility::addVectors

Add two vectors element-wise

MathUtility::addVectors( array vec1, array vec2 ): array
  • This method is static. Parameters:
Parameter Type Description
vec1 array
vec2 array

Return Value:

MathUtility::subtractVectors

Subtract two vectors element-wise

MathUtility::subtractVectors( array vec1, array vec2 ): array
  • This method is static. Parameters:
Parameter Type Description
vec1 array
vec2 array

Return Value:

MathUtility::scalarMultiply

Multiply vector by scalar

MathUtility::scalarMultiply( array vector, float scalar ): array
  • This method is static. Parameters:
Parameter Type Description
vector array
scalar float

Return Value:

MathUtility::normalize

Normalize vector (convert to unit vector)

MathUtility::normalize( array vector ): array
  • This method is static. Parameters:
Parameter Type Description
vector array

Return Value:

MathUtility::magnitude

Calculate vector magnitude (Euclidean norm)

MathUtility::magnitude( array vector ): float
  • This method is static. Parameters:
Parameter Type Description
vector array

Return Value:

MathUtility::dotProduct

Dot product of two vectors

MathUtility::dotProduct( array vec1, array vec2 ): float
  • This method is static. Parameters:
Parameter Type Description
vec1 array
vec2 array

Return Value:

MathUtility::angleBetween

Calculate angle between two vectors in radians

MathUtility::angleBetween( array vec1, array vec2 ): float
  • This method is static. Parameters:
Parameter Type Description
vec1 array
vec2 array

Return Value:

MathUtility::vectorSum

Calculate sum of vector elements

MathUtility::vectorSum( array vector ): float
  • This method is static. Parameters:
Parameter Type Description
vector array

Return Value:

MathUtility::vectorAvg

Calculate average of vector elements

MathUtility::vectorAvg( array vector ): float
  • This method is static. Parameters:
Parameter Type Description
vector array

Return Value:

MathUtility::vectorMin

Find minimum value in vector

MathUtility::vectorMin( array vector ): float
  • This method is static. Parameters:
Parameter Type Description
vector array

Return Value:

MathUtility::vectorMax

Find maximum value in vector

MathUtility::vectorMax( array vector ): float
  • This method is static. Parameters:
Parameter Type Description
vector array

Return Value:

MathUtility::crossProduct1D

1D cross product (returns scalar value)

MathUtility::crossProduct1D( array vec1, array vec2 ): float
  • This method is static. Parameters:
Parameter Type Description
vec1 array
vec2 array

Return Value:

MathUtility::projection

Project vector A onto vector B

MathUtility::projection( array vecA, array vecB ): array
  • This method is static. Parameters:
Parameter Type Description
vecA array
vecB array

Return Value:

MathUtility::vectorAppend

Append value to vector (modifies original vector)

MathUtility::vectorAppend( array &vector, float value ): mixed
  • This method is static. Parameters:
Parameter Type Description
vector array
value float

Return Value:

MathUtility::vectorReverse

Reverse vector elements

MathUtility::vectorReverse( array vector ): array
  • This method is static. Parameters:
Parameter Type Description
vector array

Return Value:

MathUtility::sin

Calculates the sine of an angle.

MathUtility::sin( float angle ): float
  • This method is static. Parameters:
Parameter Type Description
angle float The angle in radians.

Return Value:

The sine of the angle.

MathUtility::cos

Calculates the cosine of an angle.

MathUtility::cos( float angle ): float
  • This method is static. Parameters:
Parameter Type Description
angle float The angle in radians.

Return Value:

The cosine of the angle.

MathUtility::tan

Calculates the tangent of an angle.

MathUtility::tan( float angle ): float
  • This method is static. Parameters:
Parameter Type Description
angle float The angle in radians.

Return Value:

The tangent of the angle.

MathUtility::asin

Calculates the arcsine (inverse sine) of a value.

MathUtility::asin( float value ): float
  • This method is static. Parameters:
Parameter Type Description
value float The value, in the range [-1, 1].

Return Value:

The angle in radians whose sine is the given value.

MathUtility::acos

Calculates the arccosine (inverse cosine) of a value.

MathUtility::acos( float value ): float
  • This method is static. Parameters:
Parameter Type Description
value float The value, in the range [-1, 1].

Return Value:

The angle in radians whose cosine is the given value.

MathUtility::atan

Calculates the arctangent (inverse tangent) of a value.

MathUtility::atan( float value ): float
  • This method is static. Parameters:
Parameter Type Description
value float The value.

Return Value:

The angle in radians whose tangent is the given value.

MathUtility::atan2

Calculates the arctangent of y/x, using the signs of the arguments to determine the quadrant of the result.

MathUtility::atan2( float y, float x ): float
  • This method is static. Parameters:
Parameter Type Description
y float The y-coordinate.
x float The x-coordinate.

Return Value:

The angle in radians.

MathUtility::sinh

Calculates the hyperbolic sine of a value.

MathUtility::sinh( float value ): float
  • This method is static. Parameters:
Parameter Type Description
value float The value.

Return Value:

The hyperbolic sine of the value.

MathUtility::cosh

Calculates the hyperbolic cosine of a value.

MathUtility::cosh( float value ): float
  • This method is static. Parameters:
Parameter Type Description
value float The value.

Return Value:

The hyperbolic cosine of the value.

MathUtility::tanh

Calculates the hyperbolic tangent of a value.

MathUtility::tanh( float value ): float
  • This method is static. Parameters:
Parameter Type Description
value float The value.

Return Value:

The hyperbolic tangent of the value.

MathUtility::asinh

Calculates the inverse hyperbolic sine of a value.

MathUtility::asinh( float value ): float
  • This method is static. Parameters:
Parameter Type Description
value float The value.

Return Value:

The inverse hyperbolic sine of the value.

MathUtility::acosh

Calculates the inverse hyperbolic cosine of a value.

MathUtility::acosh( float value ): float
  • This method is static. Parameters:
Parameter Type Description
value float The value.

Return Value:

The inverse hyperbolic cosine of the value.

MathUtility::atanh

Calculates the inverse hyperbolic tangent of a value.

MathUtility::atanh( float value ): float
  • This method is static. Parameters:
Parameter Type Description
value float The value.

Return Value:

The inverse hyperbolic tangent of the value.

MathUtility::deg2rad

Converts an angle from degrees to radians.

MathUtility::deg2rad( float degrees ): float
  • This method is static. Parameters:
Parameter Type Description
degrees float The angle in degrees.

Return Value:

The angle in radians.

MathUtility::rad2deg

Converts an angle from radians to degrees.

MathUtility::rad2deg( float radians ): float
  • This method is static. Parameters:
Parameter Type Description
radians float The angle in radians.

Return Value:

The angle in degrees.

MathUtility::exponential

Calculate the exponential of a number.

MathUtility::exponential( float x ): float
  • This method is static. Parameters:
Parameter Type Description
x float The exponent.

Return Value:

The value of e raised to the power of x.

MathUtility::naturalLog

Calculate the natural logarithm of a number.

MathUtility::naturalLog( float x ): float
  • This method is static. Parameters:
Parameter Type Description
x float The number to calculate the logarithm for.

Return Value:

The natural logarithm of x.

MathUtility::logBase10

Calculate the base 10 logarithm of a number.

MathUtility::logBase10( float x ): float
  • This method is static. Parameters:
Parameter Type Description
x float The number to calculate the logarithm for.

Return Value:

The base 10 logarithm of x.

MathUtility::logBase2

Calculate the base 2 logarithm of a number.

MathUtility::logBase2( float x ): float
  • This method is static. Parameters:
Parameter Type Description
x float The number to calculate the logarithm for.

Return Value:

The base 2 logarithm of x.

MathUtility::logBase

Calculate the logarithm of a number with an arbitrary base.

MathUtility::logBase( float x, float base ): float
  • This method is static. Parameters:
Parameter Type Description
x float The number to calculate the logarithm for.
base float The base of the logarithm.

Return Value:

The logarithm of x with the specified base.

MathUtility::changeBase

Change the base of a logarithm from one base to another.

MathUtility::changeBase( float x, float fromBase, float toBase ): float
  • This method is static. Parameters:
Parameter Type Description
x float The number to calculate the logarithm for.
fromBase float The original base of the logarithm.
toBase float The new base for the logarithm.

Return Value:

The logarithm of x with the new base.

MathUtility::inverseNaturalLog

Calculate the inverse of the natural logarithm.

MathUtility::inverseNaturalLog( float y ): float
  • This method is static. Parameters:
Parameter Type Description
y float The value to calculate the inverse for.

Return Value:

The value of e raised to the power of y.

MathUtility::inverseLogBase10

Calculate the inverse of the base 10 logarithm.

MathUtility::inverseLogBase10( float y ): float
  • This method is static. Parameters:
Parameter Type Description
y float The value to calculate the inverse for.

Return Value:

The value of 10 raised to the power of y.

MathUtility::inverseLogBase2

Calculate the inverse of the base 2 logarithm.

MathUtility::inverseLogBase2( float y ): float
  • This method is static. Parameters:
Parameter Type Description
y float The value to calculate the inverse for.

Return Value:

The value of 2 raised to the power of y.

MathUtility::exponentialGrowth

Calculate exponential growth.

MathUtility::exponentialGrowth( float initial, float rate, float time ): float
  • This method is static. Parameters:
Parameter Type Description
initial float The initial amount.
rate float The growth rate.
time float The time period.

Return Value:

The amount after exponential growth.

MathUtility::exponentialDecay

Calculate exponential decay.

MathUtility::exponentialDecay( float initial, float rate, float time ): float
  • This method is static. Parameters:
Parameter Type Description
initial float The initial amount.
rate float The decay rate.
time float The time period.

Return Value:

The amount after exponential decay.

MathUtility::power

Calculate the power of a base raised to an exponent.

MathUtility::power( float base, float exponent ): float
  • This method is static. Parameters:
Parameter Type Description
base float The base.
exponent float The exponent.

Return Value:

The result of base raised to the exponent.

MathUtility::solveExponentialEquation

Solve for x in the equation a^x = b.

MathUtility::solveExponentialEquation( float a, float b ): float
  • This method is static. Parameters:
Parameter Type Description
a float The base.
b float The result.

Return Value:

The value of x.

MathUtility::logFactorial

Calculate the logarithm of a factorial (log(n!)).

MathUtility::logFactorial( int n ): float
  • This method is static. Parameters:
Parameter Type Description
n int A non-negative integer.

Return Value:

The logarithm of n!.

MathUtility::addMatrix

Add two matrices.

MathUtility::addMatrix( array matrixA, array matrixB ): array
  • This method is static. Parameters:
Parameter Type Description
matrixA array The first matrix.
matrixB array The second matrix.

Return Value:

The resulting matrix after addition.

MathUtility::subtractMatrix

Subtract two matrices.

MathUtility::subtractMatrix( array matrixA, array matrixB ): array
  • This method is static. Parameters:
Parameter Type Description
matrixA array The first matrix.
matrixB array The second matrix.

Return Value:

The resulting matrix after subtraction.

MathUtility::multiplyMatrix

Multiply two matrices.

MathUtility::multiplyMatrix( array matrixA, array matrixB ): array
  • This method is static. Parameters:
Parameter Type Description
matrixA array The first matrix.
matrixB array The second matrix.

Return Value:

The resulting matrix after multiplication.

MathUtility::inverseMatrix

Calculate the inverse of a matrix.

MathUtility::inverseMatrix( array matrix ): array
  • This method is static. Parameters:
Parameter Type Description
matrix array The matrix to invert.

Return Value:

The inverted matrix.

MathUtility::eigenvaluesMatrix

Get the eigenvalues of a matrix (simplified for 2x2 matrices).

MathUtility::eigenvaluesMatrix( array matrix ): array
  • This method is static. Parameters:
Parameter Type Description
matrix array The matrix to find eigenvalues for.

Return Value:

The eigenvalues of the matrix.

MathUtility::luDecompositionMatrix

Perform LU decomposition of a matrix.

MathUtility::luDecompositionMatrix( array matrix ): array
  • This method is static. Parameters:
Parameter Type Description
matrix array The matrix to decompose.

Return Value:

An array containing matrices L and U.

MathUtility::qrDecompositionMatrix

Perform QR decomposition of a matrix using Gram-Schmidt process.

MathUtility::qrDecompositionMatrix( array matrix ): array
  • This method is static. Parameters:
Parameter Type Description
matrix array The matrix to decompose.

Return Value:

An array containing matrices Q and R.

MathUtility::subsetMatrix

Get a subset of a matrix.

MathUtility::subsetMatrix( array matrix, int startRow, int startCol, int numRows, int numCols ): array
  • This method is static. Parameters:
Parameter Type Description
matrix array The original matrix.
startRow int The starting row index.
startCol int The starting column index.
numRows int The number of rows to include.
numCols int The number of columns to include.

Return Value:

The subset of the matrix.

MathUtility::mean

Calculate the mean of an array of numbers.

MathUtility::mean( array data ): float
  • This method is static. Parameters:
Parameter Type Description
data array The input array of numbers.

Return Value:

The mean of the numbers.

MathUtility::median

Calculate the median of an array of numbers.

MathUtility::median( array data ): float
  • This method is static. Parameters:
Parameter Type Description
data array The input array of numbers.

Return Value:

The median of the numbers.

MathUtility::mode

Calculate the mode of an array of numbers.

MathUtility::mode( array data ): array
  • This method is static. Parameters:
Parameter Type Description
data array The input array of numbers.

Return Value:

The mode(s) of the numbers.

MathUtility::variance

Calculate the sample variance of an array of numbers.

MathUtility::variance( array data ): float
  • This method is static. Parameters:
Parameter Type Description
data array The input array of numbers.

Return Value:

The sample variance of the numbers.

MathUtility::populationVariance

Calculate the population variance of an array of numbers.

MathUtility::populationVariance( array data ): float
  • This method is static. Parameters:
Parameter Type Description
data array The input array of numbers.

Return Value:

The population variance of the numbers.

MathUtility::standardDeviation

Calculate the sample standard deviation of an array of numbers.

MathUtility::standardDeviation( array data ): float
  • This method is static. Parameters:
Parameter Type Description
data array The input array of numbers.

Return Value:

The sample standard deviation of the numbers.

MathUtility::populationStandardDeviation

Calculate the population standard deviation of an array of numbers.

MathUtility::populationStandardDeviation( array data ): float
  • This method is static. Parameters:
Parameter Type Description
data array The input array of numbers.

Return Value:

The population standard deviation of the numbers.

MathUtility::correlation

Calculate the correlation coefficient between two variables.

MathUtility::correlation( array x, array y ): float
  • This method is static. Parameters:
Parameter Type Description
x array The first variable (independent).
y array The second variable (dependent).

Return Value:

The correlation coefficient.

MathUtility::multipleLinearRegression

Perform multiple linear regression to calculate coefficients.

MathUtility::multipleLinearRegression( array X, array Y ): array
  • This method is static. Parameters:
Parameter Type Description
X array The independent variables (features).
Y array The dependent variable (target).

Return Value:

The coefficients of the regression model.

MathUtility::normalDistributionPDF

Calculate the normal distribution PDF.

MathUtility::normalDistributionPDF( float x, float mean, float stdDev ): float
  • This method is static. Parameters:
Parameter Type Description
x float The value for which to calculate the PDF.
mean float The mean of the distribution.
stdDev float The standard deviation of the distribution.

Return Value:

The PDF value.

MathUtility::normalDistributionCDF

Calculate the normal distribution CDF.

MathUtility::normalDistributionCDF( float x, float mean, float stdDev ): float
  • This method is static. Parameters:
Parameter Type Description
x float The value for which to calculate the CDF.
mean float The mean of the distribution.
stdDev float The standard deviation of the distribution.

Return Value:

The CDF value.

MathUtility::binomialProbability

Calculate the binomial probability.

MathUtility::binomialProbability( int n, int k, float p ): float
  • This method is static. Parameters:
Parameter Type Description
n int The number of trials.
k int The number of successes.
p float The probability of success.

Return Value:

The binomial probability.

MathUtility::poissonDistribution

Calculate the Poisson distribution PDF.

MathUtility::poissonDistribution( int x, float lambda ): float
  • This method is static. Parameters:
Parameter Type Description
x int The number of occurrences.
lambda float The expected number of occurrences.

Return Value:

The PDF value.

MathUtility::exponentialDistributionPDF

Calculate the exponential distribution PDF.

MathUtility::exponentialDistributionPDF( float x, float lambda ): float
  • This method is static. Parameters:
Parameter Type Description
x float The value for which to calculate the PDF.
lambda float The rate parameter.

Return Value:

The PDF value.

MathUtility::exponentialDistributionCDF

Calculate the exponential distribution CDF.

MathUtility::exponentialDistributionCDF( float x, float lambda ): float
  • This method is static. Parameters:
Parameter Type Description
x float The value for which to calculate the CDF.
lambda float The rate parameter.

Return Value:

The CDF value.

MathUtility::uniformDistributionPDF

Calculate the uniform distribution PDF.

MathUtility::uniformDistributionPDF( float x, float a, float b ): float
  • This method is static. Parameters:
Parameter Type Description
x float The value for which to calculate the PDF.
a float The lower bound of the distribution.
b float The upper bound of the distribution.

Return Value:

The PDF value.

MathUtility::uniformDistributionCDF

Calculate the uniform distribution CDF.

MathUtility::uniformDistributionCDF( float x, float a, float b ): float
  • This method is static. Parameters:
Parameter Type Description
x float The value for which to calculate the CDF.
a float The lower bound of the distribution.
b float The upper bound of the distribution.

Return Value:

The CDF value.

MathUtility::skewness

Calculate the sample skewness of an array of numbers.

MathUtility::skewness( array data ): float
  • This method is static. Parameters:
Parameter Type Description
data array The input array of numbers.

Return Value:

The skewness of the numbers.

MathUtility::kurtosis

Calculate the sample kurtosis of an array of numbers.

MathUtility::kurtosis( array data ): float
  • This method is static. Parameters:
Parameter Type Description
data array The input array of numbers.

Return Value:

The kurtosis of the numbers.

MathUtility::gcd

Calculate the greatest common divisor (GCD) of two numbers.

MathUtility::gcd( int a, int b ): int
  • This method is static. Parameters:
Parameter Type Description
a int First number
b int Second number

Return Value:

GCD of the two numbers

MathUtility::lcm

Calculate the least common multiple (LCM) of two numbers.

MathUtility::lcm( int a, int b ): int
  • This method is static. Parameters:
Parameter Type Description
a int First number
b int Second number

Return Value:

LCM of the two numbers

MathUtility::isPrime

Check if a number is prime.

MathUtility::isPrime( int n ): bool
  • This method is static. Parameters:
Parameter Type Description
n int The number to check

Return Value:

True if the number is prime, false otherwise

MathUtility::generatePrimes

Generate a list of prime numbers up to a given limit.

MathUtility::generatePrimes( int limit ): array
  • This method is static. Parameters:
Parameter Type Description
limit int The upper limit

Return Value:

An array of prime numbers

MathUtility::fibonacci

Calculate the Fibonacci number at a given position.

MathUtility::fibonacci( int n ): int
  • This method is static. Parameters:
Parameter Type Description
n int The position in the Fibonacci sequence

Return Value:

The Fibonacci number at that position

MathUtility::isPerfectSquare

Check if a number is a perfect square.

MathUtility::isPerfectSquare( int n ): bool
  • This method is static. Parameters:
Parameter Type Description
n int The number to check

Return Value:

True if the number is a perfect square, false otherwise

MathUtility::primeFactorization

Find the prime factorization of a number.

MathUtility::primeFactorization( int n ): array
  • This method is static. Parameters:
Parameter Type Description
n int The number to factor

Return Value:

An array of prime factors

MathUtility::sumOfDivisors

Calculate the sum of divisors of a number.

MathUtility::sumOfDivisors( int n ): int
  • This method is static. Parameters:
Parameter Type Description
n int The number to calculate the sum of divisors for

Return Value:

The sum of divisors of the number

MathUtility::eulerTotient

Calculate Euler's Totient function for a given number.

MathUtility::eulerTotient( int n ): int
  • This method is static. Parameters:
Parameter Type Description
n int The number to calculate the Totient for

Return Value:

The value of Euler's Totient function

MathUtility::areCoprime

Check if two numbers are coprime (i.e., their GCD is 1).

MathUtility::areCoprime( int a, int b ): bool
  • This method is static. Parameters:
Parameter Type Description
a int First number
b int Second number

Return Value:

True if the numbers are coprime, false otherwise

MathUtility::generatePerfectNumbers

Generate a list of perfect numbers up to a given limit.

MathUtility::generatePerfectNumbers( int limit ): array
  • This method is static. Parameters:
Parameter Type Description
limit int The upper limit

Return Value:

An array of perfect numbers

MathUtility::differentiate

MathUtility::differentiate( mixed function, mixed x, mixed h = 1.0E-10 ): mixed
  • This method is static. Parameters:
Parameter Type Description
function mixed
x mixed
h mixed

Return Value:

MathUtility::integrate

MathUtility::integrate( array coefficients ): mixed
  • This method is static. Parameters:
Parameter Type Description
coefficients array

Return Value:

MathUtility::evaluate

MathUtility::evaluate( array coefficients, mixed x ): mixed
  • This method is static. Parameters:
Parameter Type Description
coefficients array
x mixed

Return Value:

MathUtility::findQuadraticRoots

MathUtility::findQuadraticRoots( mixed a, mixed b, mixed c ): mixed
  • This method is static. Parameters:
Parameter Type Description
a mixed
b mixed
c mixed

Return Value:

MathUtility::limit

MathUtility::limit( mixed function, mixed x, mixed h = 1.0E-10 ): mixed
  • This method is static. Parameters:
Parameter Type Description
function mixed
x mixed
h mixed

Return Value:

MathUtility::taylorSeries

MathUtility::taylorSeries( mixed function, mixed x, mixed n ): mixed
  • This method is static. Parameters:
Parameter Type Description
function mixed
x mixed
n mixed

Return Value:

MathUtility::numericalIntegration

MathUtility::numericalIntegration( mixed function, mixed a, mixed b, mixed n = 1000 ): mixed
  • This method is static. Parameters:
Parameter Type Description
function mixed
a mixed
b mixed
n mixed

Return Value:

MathUtility::partialDerivative

MathUtility::partialDerivative( mixed function, mixed varIndex, mixed point, mixed h = 1.0E-10 ): mixed
  • This method is static. Parameters:
Parameter Type Description
function mixed
varIndex mixed
point mixed
h mixed

Return Value:

MathUtility::gradient

MathUtility::gradient( mixed function, mixed point, mixed h = 1.0E-10 ): mixed
  • This method is static. Parameters:
Parameter Type Description
function mixed
point mixed
h mixed

Return Value:

MathUtility::secondDerivative

MathUtility::secondDerivative( mixed function, mixed x, mixed h = 1.0E-10 ): mixed
  • This method is static. Parameters:
Parameter Type Description
function mixed
x mixed
h mixed

Return Value:

MathUtility::findLocalExtrema

MathUtility::findLocalExtrema( mixed function, mixed x0, mixed h = 1.0E-10 ): mixed
  • This method is static. Parameters:
Parameter Type Description
function mixed
x0 mixed
h mixed

Return Value:

MathUtility::areaUnderCurve

MathUtility::areaUnderCurve( mixed function, mixed a, mixed b, mixed n = 1000 ): mixed
  • This method is static. Parameters:
Parameter Type Description
function mixed
a mixed
b mixed
n mixed

Return Value:

MathUtility::areaOfCircle

Calculate the area of a circle.

MathUtility::areaOfCircle( float radius ): float
  • This method is static. Parameters:
Parameter Type Description
radius float The radius of the circle.

Return Value:

The area of the circle.

MathUtility::circumferenceOfCircle

Calculate the circumference of a circle.

MathUtility::circumferenceOfCircle( float radius ): float
  • This method is static. Parameters:
Parameter Type Description
radius float The radius of the circle.

Return Value:

The circumference of the circle.

MathUtility::areaOfRectangle

Calculate the area of a rectangle.

MathUtility::areaOfRectangle( float length, float width ): float
  • This method is static. Parameters:
Parameter Type Description
length float The length of the rectangle.
width float The width of the rectangle.

Return Value:

The area of the rectangle.

MathUtility::perimeterOfRectangle

Calculate the perimeter of a rectangle.

MathUtility::perimeterOfRectangle( float length, float width ): float
  • This method is static. Parameters:
Parameter Type Description
length float The length of the rectangle.
width float The width of the rectangle.

Return Value:

The perimeter of the rectangle.

MathUtility::areaOfTriangle

Calculate the area of a triangle.

MathUtility::areaOfTriangle( float base, float height ): float
  • This method is static. Parameters:
Parameter Type Description
base float The base of the triangle.
height float The height of the triangle.

Return Value:

The area of the triangle.

MathUtility::perimeterOfTriangle

Calculate the perimeter of a triangle (assuming it's a right triangle).

MathUtility::perimeterOfTriangle( float a, float b, float c ): float
  • This method is static. Parameters:
Parameter Type Description
a float The length of the first side.
b float The length of the second side.
c float The length of the third side.

Return Value:

The perimeter of the triangle.

MathUtility::areaOfSquare

Calculate the area of a square.

MathUtility::areaOfSquare( float side ): float
  • This method is static. Parameters:
Parameter Type Description
side float The length of a side of the square.

Return Value:

The area of the square.

MathUtility::perimeterOfSquare

Calculate the perimeter of a square.

MathUtility::perimeterOfSquare( float side ): float
  • This method is static. Parameters:
Parameter Type Description
side float The length of a side of the square.

Return Value:

The perimeter of the square.

MathUtility::volumeOfCube

Calculate the volume of a cube.

MathUtility::volumeOfCube( float side ): float
  • This method is static. Parameters:
Parameter Type Description
side float The length of a side of the cube.

Return Value:

The volume of the cube.

MathUtility::surfaceAreaOfCube

Calculate the surface area of a cube.

MathUtility::surfaceAreaOfCube( float side ): float
  • This method is static. Parameters:
Parameter Type Description
side float The length of a side of the cube.

Return Value:

The surface area of the cube.

MathUtility::volumeOfRectangularPrism

Calculate the volume of a rectangular prism.

MathUtility::volumeOfRectangularPrism( float length, float width, float height ): float
  • This method is static. Parameters:
Parameter Type Description
length float The length of the prism.
width float The width of the prism.
height float The height of the prism.

Return Value:

The volume of the rectangular prism.

MathUtility::surfaceAreaOfRectangularPrism

Calculate the surface area of a rectangular prism.

MathUtility::surfaceAreaOfRectangularPrism( float length, float width, float height ): float
  • This method is static. Parameters:
Parameter Type Description
length float The length of the prism.
width float The width of the prism.
height float The height of the prism.

Return Value:

The surface area of the rectangular prism.

MathUtility::areaOfTrapezoid

Calculate the area of a trapezoid.

MathUtility::areaOfTrapezoid( float base1, float base2, float height ): float
  • This method is static. Parameters:
Parameter Type Description
base1 float The length of the first base.
base2 float The length of the second base.
height float The height of the trapezoid.

Return Value:

The area of the trapezoid.

MathUtility::areaOfParallelogram

Calculate the area of a parallelogram.

MathUtility::areaOfParallelogram( float base, float height ): float
  • This method is static. Parameters:
Parameter Type Description
base float The length of the base.
height float The height of the parallelogram.

Return Value:

The area of the parallelogram.

MathUtility::areaOfEllipse

Calculate the area of an ellipse.

MathUtility::areaOfEllipse( float semiMajorAxis, float semiMinorAxis ): float
  • This method is static. Parameters:
Parameter Type Description
semiMajorAxis float The length of the semi-major axis.
semiMinorAxis float The length of the semi-minor axis.

Return Value:

The area of the ellipse.

MathUtility::circumferenceOfEllipse

Calculate the circumference of an ellipse (approximation).

MathUtility::circumferenceOfEllipse( float semiMajorAxis, float semiMinorAxis ): float
  • This method is static. Parameters:
Parameter Type Description
semiMajorAxis float The length of the semi-major axis.
semiMinorAxis float The length of the semi-minor axis.

Return Value:

The circumference of the ellipse.

PHP

  • Full name: \PHPallas\Utilities\PHP

PHP::version

Get PHP version

PHP::version(  ): bool|string
  • This method is static.

Return Value:

PHP::versionID

Get PHP version as a number

PHP::versionID(  ): int
  • This method is static.

Return Value:

PHP::versionMajor

Get PHP major version

PHP::versionMajor(  ): int|string
  • This method is static.

Return Value:

PHP::versionMinor

Get PHP minor Version

PHP::versionMinor(  ): int|string
  • This method is static.

Return Value:

PHP::versionRelease

Get PHP release version

PHP::versionRelease(  ): int|string
  • This method is static.

Return Value:

Polyfill

  • Full name: \PHPallas\Utilities\Polyfill

Polyfill::mb_str_pad

Polyfill::mb_str_pad( mixed input, mixed pad_length, mixed pad_string = ' ', mixed pad_type = STR_PAD_RIGHT, mixed encoding = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
input mixed
pad_length mixed
pad_string mixed
pad_type mixed
encoding mixed

Return Value:

Polyfill::mb_strlen

Polyfill::mb_strlen( mixed string, mixed encoding = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed
encoding mixed

Return Value:

Polyfill::mb_internal_encoding

Polyfill::mb_internal_encoding( mixed encoding = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
encoding mixed

Return Value:

Polyfill::iconv

Polyfill::iconv( mixed in_charset, mixed out_charset, mixed str ): mixed
  • This method is static. Parameters:
Parameter Type Description
in_charset mixed
out_charset mixed
str mixed

Return Value:

Polyfill::mb_split

Polyfill::mb_split( mixed pattern, mixed string, mixed encoding = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
pattern mixed
string mixed
encoding mixed

Return Value:

Polyfill::mb_str_split

Polyfill::mb_str_split( mixed string, mixed length = 1, mixed encoding = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed
length mixed
encoding mixed

Return Value:

Polyfill::mb_substr

Polyfill::mb_substr( mixed string, mixed start, mixed length = null, mixed encoding = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed
start mixed
length mixed
encoding mixed

Return Value:

Polyfill::mb_trim

Polyfill::mb_trim( mixed string, mixed character_mask = null, mixed encoding = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed
character_mask mixed
encoding mixed

Return Value:

Polyfill::mb_ltrim

Polyfill::mb_ltrim( mixed string, mixed character_mask, mixed encoding ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed
character_mask mixed
encoding mixed

Return Value:

Polyfill::mb_rtrim

Polyfill::mb_rtrim( mixed string, mixed character_mask, mixed encoding ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed
character_mask mixed
encoding mixed

Return Value:

Polyfill::mb_strpos

Polyfill::mb_strpos( mixed haystack, mixed needle, mixed offset, mixed encoding = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
haystack mixed
needle mixed
offset mixed
encoding mixed

Return Value:

Polyfill::mb_strrev

Polyfill::mb_strrev( mixed string, mixed encoding = 'UTF-8' ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed
encoding mixed

Return Value:

Polyfill::mb_str_shuffle

Polyfill::mb_str_shuffle( mixed string, mixed encoding = 'UTF-8' ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed
encoding mixed

Return Value:

Polyfill::chr

Polyfill::chr( mixed ascii ): mixed
  • This method is static. Parameters:
Parameter Type Description
ascii mixed

Return Value:

Polyfill::polyfill_mb_detect_encoding

Polyfill::polyfill_mb_detect_encoding( mixed string, mixed encodings = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed
encodings mixed

Return Value:

Polyfill::mb_detect_encoding

Polyfill::mb_detect_encoding( mixed string, mixed encodings = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed
encodings mixed

Return Value:

Polyfill::mb_detect_order

Polyfill::mb_detect_order( mixed order = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
order mixed

Return Value:

Polyfill::ord

Polyfill::ord( mixed string ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed

Return Value:

Polyfill::mb_ord

Polyfill::mb_ord( mixed char ): mixed
  • This method is static. Parameters:
Parameter Type Description
char mixed

Return Value:

Polyfill::str_contains

Polyfill::str_contains( mixed haystack, mixed needle, mixed encoding = 'UTF-8' ): mixed
  • This method is static. Parameters:
Parameter Type Description
haystack mixed
needle mixed
encoding mixed

Return Value:

Polyfill::str_starts_with

Polyfill::str_starts_with( mixed haystack, mixed needle, mixed encoding = 'UTF-8' ): mixed
  • This method is static. Parameters:
Parameter Type Description
haystack mixed
needle mixed
encoding mixed

Return Value:

Polyfill::str_ends_with

Polyfill::str_ends_with( mixed haystack, mixed needle, mixed encoding = 'UTF-8' ): mixed
  • This method is static. Parameters:
Parameter Type Description
haystack mixed
needle mixed
encoding mixed

Return Value:

Polyfill::mb_chr

Polyfill::mb_chr( mixed codepoint ): mixed
  • This method is static. Parameters:
Parameter Type Description
codepoint mixed

Return Value:

Polyfill::mb_convert_encoding

Polyfill::mb_convert_encoding( mixed string, mixed to_encoding, mixed from_encoding = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed
to_encoding mixed
from_encoding mixed

Return Value:

Polyfill::mb_check_encoding

Polyfill::mb_check_encoding( mixed string, mixed encoding = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
string mixed
encoding mixed

Return Value:

Polyfill::password_verify

Polyfill::password_verify( mixed password, mixed hash ): mixed
  • This method is static. Parameters:
Parameter Type Description
password mixed
hash mixed

Return Value:

Polyfill::password_hash

Polyfill::password_hash( mixed password, mixed algo = PASSWORD_DEFAULT, array options = [] ): mixed
  • This method is static. Parameters:
Parameter Type Description
password mixed
algo mixed
options array

Return Value:

SqlUtility

  • Full name: \PHPallas\Utilities\SqlUtility

SqlUtility::selectQuery

selectQuery is a versatile function that dynamically builds a SQL SELECT statement based on the provided parameters. It handles various SQL syntax differences across multiple database systems, ensuring that the correct syntax is used for limiting results, grouping, ordering, and filtering data. The method is designed to be flexible and reusable for different database interactions.

SqlUtility::selectQuery( string|array table, string|array|null fields = "*", mixed joins = [], array where = [], array order = [], array group = [], array having = [], mixed limit = null, int database = 9, mixed distinct = false ): array
  • This method is static. Parameters:
Parameter Type Description
table string|array
fields string|array|null
joins mixed
where array
order array
group array
having array
limit mixed
database int
distinct mixed

Return Value:

SqlUtility::updateQuery

The updateQuery method is a flexible function that constructs a SQL UPDATE statement dynamically based on the provided parameters. It handles the creation of the SET and WHERE clauses, ensuring proper parameter binding to prevent SQL injection. This method is designed to be reusable for updating rows in different tables with varying conditions.

SqlUtility::updateQuery( string table, array values, array where, mixed return = false, mixed limit = null, mixed database = 9 ): array
  • This method is static. Parameters:
Parameter Type Description
table string
values array
where array
return mixed
limit mixed
database mixed

Return Value:

SqlUtility::deleteQuery

The deleteQuery method is a straightforward function that constructs a SQL DELETE statement dynamically based on the provided parameters. It builds the WHERE clause to specify which rows to delete, ensuring proper parameter binding to prevent SQL injection. This method is designed to be reusable for deleting records from different tables based on various conditions.

SqlUtility::deleteQuery( string table, array where = [], mixed order = [], mixed limit = null, mixed alias = null, mixed database = 9 ): array
  • This method is static. Parameters:
Parameter Type Description
table string
where array
order mixed
limit mixed
alias mixed
database mixed

Return Value:

SqlUtility::insertQuery

This function is designed to handle both single-row and multi-row inserts into a database table. It dynamically constructs the SQL query and ensures that parameter names are unique to prevent conflicts during execution.

SqlUtility::insertQuery( string table, array values, mixed ignore = false, mixed return = false, mixed database = 9 ): array
  • This method is static. Parameters:
Parameter Type Description
table string
values array
ignore mixed
return mixed
database mixed

Return Value:

SqlUtility::unionQuery

SqlUtility::unionQuery( mixed selects, mixed full = false ): mixed
  • This method is static. Parameters:
Parameter Type Description
selects mixed
full mixed

Return Value:

SqlUtility::buildOrderClause

SqlUtility::buildOrderClause( mixed order ): mixed
  • This method is static. Parameters:
Parameter Type Description
order mixed

Return Value:

SqlUtility::buildWhereClause

SqlUtility::buildWhereClause( mixed conditions, mixed &params ): mixed
  • This method is static. Parameters:
Parameter Type Description
conditions mixed
params mixed

Return Value:

StringUtility

Class StringUtility

A comprehensive utility class designed to facilitate various string manipulations and transformations. This class provides methods for creating, modifying, encoding, decoding, hashing, and checking strings in a consistent and reusable manner. It includes functionalities such as string creation, substring retrieval, character manipulation, phrase checking, and various encoding/decoding techniques.

The utility also supports different string formats and transformations, making it a versatile tool for developers working with string data in PHP applications.

  • Full name: \PHPallas\Utilities\StringUtility

StringUtility::create

Creates a string consisting of a specified character repeated to a given length.

StringUtility::create( string character, int length ): string

This method generates a string where the specified character is repeated until the desired length is achieved. If the length is less than or equal to zero, an empty string is returned.

  • This method is static. Parameters:
Parameter Type Description
character string The character to repeat.
length int The total length of the resulting string.

Return Value:

The resulting string filled with the specified character.

StringUtility::createRandom

Generates a random string of a specified length using the provided characters.

StringUtility::createRandom( int length = 8, string characters = "abcdefghijklmnopqrstuvwxyz" ): string

This method creates a random string by selecting characters from the provided set. If the length is not specified, it defaults to 8. The characters can be customized to include any valid characters.

  • This method is static. Parameters:
Parameter Type Description
length int The length of the random string to create. Default is
  1. | | characters | string | The characters to use for generating the random string. Default is lowercase letters. |

Return Value:

The generated random string.

StringUtility::createByRepeat

Repeats a given string a specified number of times.

StringUtility::createByRepeat( string string, int times ): string

This method takes an input string and repeats it the specified number of times. If the times parameter is less than or equal to zero, an empty string is returned.

  • This method is static. Parameters:
Parameter Type Description
string string The string to repeat.
times int The number of times to repeat the string.

Return Value:

The resulting string after repetition.

StringUtility::get

Retrieves a character from a string at a specified index.

StringUtility::get( string string, int index ): string

This method splits the given string into an array of characters and returns the character at the specified index. If the index is out of bounds, it returns an empty string.

  • This method is static. Parameters:
Parameter Type Description
string string The input string from which to retrieve the character.
index int The index of the character to retrieve.

Return Value:

The character at the specified index, or an empty string if not found.

StringUtility::getSubset

Retrieves a subset of a string starting from a given index.

StringUtility::getSubset( string string, int startIndex, int|null length, string encoding = 'UTF-8' ): string

This method extracts a substring from the input string, starting at the specified index and continuing for the specified length. It uses the multibyte string function if available, falling back to standard string functions otherwise.

  • This method is static. Parameters:
Parameter Type Description
string string The input string from which to extract the subset.
startIndex int The starting index for the substring.
length int|null The length of the substring. If null, the substring extends to the end of the string.
encoding string The character encoding. Default is 'UTF-8'.

Return Value:

The extracted substring.

StringUtility::getSegment

Retrieves a segment of a string between two specified indices.

StringUtility::getSegment( string string, int startIndex, int endIndex ): string

This method extracts a substring from the input string starting at the specified start index and ending at the specified end index.

  • This method is static. Parameters:
Parameter Type Description
string string The input string from which to extract the segment.
startIndex int The starting index of the segment.
endIndex int The ending index of the segment.

Return Value:

The extracted segment of the string.

StringUtility::set

Sets a character at a specified index in the given string.

StringUtility::set( string string, int index, string value ): string

This method splits the string into an array of characters, replaces the character at the specified index with the provided value, and then reconstructs the string from the modified array.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.
index int The index at which to set the new character.
value string The character to set at the specified index.

Return Value:

The modified string with the character set at the index.

StringUtility::setReplace

Replaces occurrences of a substring within a string.

StringUtility::setReplace( string string, string needle, string replace, bool caseSensitive = false ): string

This method replaces all instances of the specified needle with the replacement value. It can perform case-sensitive or case-insensitive replacements based on the provided flag.

  • This method is static. Parameters:
Parameter Type Description
string string The input string in which to perform the replacement.
needle string The substring to be replaced.
replace string The substring to replace with.
caseSensitive bool Indicates whether the replacement should be
case-sensitive. Default is false.

Return Value:

The modified string with replacements made.

StringUtility::setInStart

Pads the string on the left with a specified character to a given length.

StringUtility::setInStart( string string, string character, int length ): string

This method adds the specified character to the start of the string until the desired length is reached.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to pad.
character string The character to use for padding.
length int The total length of the resulting string after padding.

Return Value:

The left-padded string.

StringUtility::setInEnd

Pads the string on the right with a specified character to a given length.

StringUtility::setInEnd( string string, string character, int length ): string

This method adds the specified character to the end of the string until the desired length is reached.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to pad.
character string The character to use for padding.
length int The total length of the resulting string after padding.

Return Value:

The right-padded string.

StringUtility::hasPhrase

Checks if a specified phrase exists within a given string.

StringUtility::hasPhrase( string string, string needle, bool caseSensitive = true ): bool

This method determines whether the needle (substring) is present in the string, with an option for case sensitivity. If case sensitivity is disabled, both the string and the needle are transformed to lowercase before the check.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to search within.
needle string The substring to search for.
caseSensitive bool Indicates whether the search should be
case-sensitive. Default is true.

Return Value:

Returns true if the needle is found in the string, false otherwise.

StringUtility::addToStart

Adds a specified value to the start of the given string.

StringUtility::addToStart( string string, string value ): string

This method concatenates the value with the input string, placing the value at the beginning.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.
value string The value to add to the start of the string.

Return Value:

The modified string with the value added at the start.

StringUtility::addToEnd

Adds a specified value to the end of the given string.

StringUtility::addToEnd( string string, string value ): string

This method concatenates the input string with the value, placing the value at the end.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.
value string The value to add to the end of the string.

Return Value:

The modified string with the value added at the end.

StringUtility::addToCenter

Adds a specified value to the center of the given string.

StringUtility::addToCenter( string string, string value ): string

This method calculates the middle of the input string and inserts the value at that position.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.
value string The value to add to the center of the string.

Return Value:

The modified string with the value added at the center.

StringUtility::addEvenly

Adds a specified value evenly throughout the given string.

StringUtility::addEvenly( string string, string value, int size ): string

This method inserts the value at regular intervals defined by the specified size within the string.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.
value string The value to insert into the string.
size int The interval size at which to insert the value.

Return Value:

The modified string with the value added evenly.

StringUtility::drop

Drops specified characters from the given string.

StringUtility::drop( string string, string characters = "\n\r\t\v\x00 ): string

This method removes all occurrences of the specified characters from the input string. By default, it drops whitespace and control characters.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.
characters string The characters to drop from the string.

Return Value:

The modified string with the specified characters removed.

StringUtility::dropFirst

Drops the first character from the given string.

StringUtility::dropFirst( string string ): string

This method removes the first character of the input string and returns the modified string.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.

Return Value:

The modified string with the first character removed.

StringUtility::dropLast

Drops the last character from the given string.

StringUtility::dropLast( string string ): string

This method removes the last character of the input string and returns the modified string.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.

Return Value:

The modified string with the last character removed.

StringUtility::dropNth

Drops the character at the specified index from the given string.

StringUtility::dropNth( string string, int index ): string

This method removes the character at the specified index and returns the modified string.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.
index int The index of the character to drop.

Return Value:

The modified string with the character at the specified index removed.

StringUtility::dropFromSides

Drops specified characters from both ends of the given string.

StringUtility::dropFromSides( string string, string characters = "\n\r\t\v\x00" ): string

This method trims the specified characters from the start and end of the input string.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.
characters string The characters to drop from both ends.

Return Value:

The modified string with specified characters trimmed from both ends.

StringUtility::dropFromStart

Drops specified characters from the start of the given string.

StringUtility::dropFromStart( string string, string characters = "\n\r\t\v\x00" ): string

This method removes all occurrences of the specified characters from the beginning of the input string.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.
characters string The characters to drop from the start.

Return Value:

The modified string with specified characters removed from the start.

StringUtility::dropFromEnd

Drops specified characters from the end of the given string.

StringUtility::dropFromEnd( string string, string characters = "\n\r\t\v\x00" ): string

This method removes all occurrences of the specified characters from the end of the input string.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.
characters string The characters to drop from the end.

Return Value:

The modified string with specified characters removed from the end.

StringUtility::dropSeparator

Drops specified separators from the given string.

StringUtility::dropSeparator( string string ): string

This method removes dashes and underscores from the input string.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.

Return Value:

The modified string with specified separators removed.

StringUtility::dropSpace

Drops all spaces from the given string.

StringUtility::dropSpace( string string ): string

This method removes all space characters from the input string.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to modify.

Return Value:

The modified string with all spaces removed.

StringUtility::dropExtras

Truncates a string to a specified length and appends ellipsis if needed.

StringUtility::dropExtras( string string, int length ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to truncate.
length int The maximum length of the resulting string.

Return Value:

The truncated string with ellipsis.

StringUtility::transformToReverse

Transforms the given string to its reverse.

StringUtility::transformToReverse( string string ): string

This method returns the input string reversed.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The reversed string.

StringUtility::transformToShuffle

Transforms the given string by shuffling its characters.

StringUtility::transformToShuffle( string string ): string

This method returns a new string with the characters of the input string shuffled randomly.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The shuffled string.

StringUtility::transformToNoTag

Transforms the given string by stripping HTML and PHP tags.

StringUtility::transformToNoTag( string string, string|null allowedTags = null ): string

This method removes all tags from the input string, optionally allowing specified tags.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.
allowedTags string|null Tags that should not be stripped.

Return Value:

The string with tags stripped.

StringUtility::transformToLowercase

Transforms the given string to lowercase.

StringUtility::transformToLowercase( string string, bool removeSeparators = false, bool dropSpace = false ): string

This method converts the input string to lowercase, with options to remove separators and spaces.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.
removeSeparators bool Whether to remove separators.
dropSpace bool Whether to remove spaces.

Return Value:

The lowercase string.

StringUtility::transformToUppercase

Transforms the given string to uppercase.

StringUtility::transformToUppercase( string string, bool removeSeparators = false, bool removeSpace = false ): string

This method converts the input string to uppercase, with options to remove separators and spaces.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.
removeSeparators bool Whether to remove separators.
removeSpace bool Whether to remove spaces.

Return Value:

The uppercase string.

StringUtility::transformToLowercaseFirst

Transforms the given string to lowercase, capitalizing the first character.

StringUtility::transformToLowercaseFirst( string string, bool removeSeparators = false, bool removeSpace = false ): string

This method converts the input string to lowercase, with options to remove separators and spaces.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.
removeSeparators bool Whether to remove separators.
removeSpace bool Whether to remove spaces.

Return Value:

The string with the first character in lowercase.

StringUtility::transformToUppercaseFirst

Transforms the given string to uppercase, capitalizing the first character.

StringUtility::transformToUppercaseFirst( string string, bool removeSeparators = false, bool removeSpace = false ): string

This method converts the input string to uppercase, with options to remove separators and spaces.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.
removeSeparators bool Whether to remove separators.
removeSpace bool Whether to remove spaces.

Return Value:

The string with the first character in uppercase.

StringUtility::transformToCapital

Capitalizes the first letter of each word in the string.

StringUtility::transformToCapital( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to capitalize.

Return Value:

The capitalized string.

StringUtility::transformToFlatcase

Transforms the given string to flatcase.

StringUtility::transformToFlatcase( string string ): string

This method replaces dashes and underscores with spaces, converts each word to lowercase, and removes spaces.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The flatcase string.

StringUtility::transformToPascalCase

Transforms the given string to PascalCase.

StringUtility::transformToPascalCase( string string ): string

This method replaces dashes and underscores with spaces, capitalizes each word, and joins them together.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The PascalCase string.

StringUtility::transformToCamelcase

Transforms the given string to camelCase.

StringUtility::transformToCamelcase( string string ): string

This method converts the input string to PascalCase and then lowers the first character.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The camelCase string.

StringUtility::transformToSnakecase

Transforms the given string to snake_case.

StringUtility::transformToSnakecase( string string ): string

This method replaces dashes and underscores with spaces, converts each word to lowercase, and joins them with underscores.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The snake_case string.

StringUtility::transformToMacrocase

Transforms the given string to MACROCASE.

StringUtility::transformToMacrocase( string string ): string

This method converts the input string to snake_case and then converts it to uppercase.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The MACROCASE string.

StringUtility::transformToPascalSnakecase

Transforms the given string to Pascal_Snake_Case.

StringUtility::transformToPascalSnakecase( string string ): string

This method converts the input string to PascalCase and joins them with underscores.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The Pascal_Snake_Case string.

StringUtility::transformToCamelSnakecase

Transforms the given string to camel_snake_case.

StringUtility::transformToCamelSnakecase( string string ): string

This method converts the input string to Pascal_Snake_Case and then lowers the first character.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The camel_snake_case string.

StringUtility::transformToKebabcase

Transforms the given string to kebab-case.

StringUtility::transformToKebabcase( string string ): string

This method converts the input string to snake_case and replaces underscores with dashes.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The kebab-case string.

StringUtility::transformToCobolcase

Transforms the given string to COBOLCASE.

StringUtility::transformToCobolcase( string string ): string

This method converts the input string to kebab-case and then converts it to uppercase.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The COBOLCASE string.

StringUtility::transformToTraincase

Transforms the given string to train-case.

StringUtility::transformToTraincase( string string ): string

This method converts the input string to Pascal_Snake_Case and replaces underscores with dashes.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The train-case string.

StringUtility::transformToMetaphone

Transforms the given string to its metaphone representation.

StringUtility::transformToMetaphone( string string ): string

This method returns the metaphone key for the input string.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The metaphone representation of the string.

StringUtility::transformToSoundex

Transforms the given string to its soundex representation.

StringUtility::transformToSoundex( string string ): string

This method returns the soundex key for the input string.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to transform.

Return Value:

The soundex representation of the string.

StringUtility::isEqualTo

Checks if two strings are equal.

StringUtility::isEqualTo( string string1, string string2 ): bool

This method compares two strings for strict equality.

  • This method is static. Parameters:
Parameter Type Description
string1 string The first string to compare.
string2 string The second string to compare.

Return Value:

Returns true if the strings are equal, false otherwise.

StringUtility::isSameAs

Checks if two strings are equal, ignoring case.

StringUtility::isSameAs( string string1, string string2 ): bool

This method converts both strings to lowercase and then compares them for equality.

  • This method is static. Parameters:
Parameter Type Description
string1 string The first string to compare.
string2 string The second string to compare.

Return Value:

Returns true if the strings are equal (case-insensitive), false otherwise.

StringUtility::isStartedBy

Checks if a string starts with a given substring.

StringUtility::isStartedBy( string string, string starting ): bool

This method checks if the input string begins with the specified starting substring.

  • This method is static. Parameters:
Parameter Type Description
string string The string to check.
starting string The substring to look for at the start.

Return Value:

Returns true if the string starts with the specified substring, false otherwise.

StringUtility::isEndedWith

Checks if a string ends with a given substring.

StringUtility::isEndedWith( string string, string ending ): bool

This method checks if the input string ends with the specified ending substring.

  • This method is static. Parameters:
Parameter Type Description
string string The string to check.
ending string The substring to look for at the end.

Return Value:

Returns true if the string ends with the specified substring, false otherwise.

StringUtility::isPalindrome

Checks if a string is a palindrome.

StringUtility::isPalindrome( string string ): bool
  • This method is static. Parameters:
Parameter Type Description
string string The input string to check.

Return Value:

True if the string is a palindrome, false otherwise.

StringUtility::estimateLength

Estimates the length of a string.

StringUtility::estimateLength( string string ): int

This method uses mb_strlen if available, otherwise falls back to strlen for length estimation.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to estimate the length of.

Return Value:

The estimated length of the string.

StringUtility::estimateCounts

Estimates the counts of each character in a string.

StringUtility::estimateCounts( string string ): array

This method converts the string to an array of characters and counts the occurrences of each character.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to estimate character counts.

Return Value:

An associative array where keys are characters and values are their respective counts.

StringUtility::estimateSimilarity

Compares two strings and returns a similarity score.

StringUtility::estimateSimilarity( string string1, string string2 ): float
  • This method is static. Parameters:
Parameter Type Description
string1 string The first string to compare.
string2 string The second string to compare.

Return Value:

A similarity score between 0 and 1, where 1 means identical.

StringUtility::merge

Merges multiple strings into a single string using a specified separator.

StringUtility::merge( string separator ): string

This method takes a variable number of string arguments, removes the first argument (the separator), and concatenates the remaining strings with the specified separator.

  • This method is static. Parameters:
Parameter Type Description
separator string The separator to use between the strings.

Return Value:

The merged string with the specified separator.

StringUtility::split

Splits a string into segments of specified length.

StringUtility::split( string string, int segmentLength ): array

This method uses mb_str_split from the Polyfill to handle multibyte characters properly.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to be split.
segmentLength int The length of each segment.

Return Value:

An array of string segments.

StringUtility::splitBy

Splits a string by a specified separator.

StringUtility::splitBy( string string, string separator ): array

This method uses explode to divide the string into an array based on the provided separator.

  • This method is static. Parameters:
Parameter Type Description
string string The input string to be split.
separator string The separator to split the string by.

Return Value:

An array of substrings created by splitting the input string.

StringUtility::toHex

Converts a string to its hexadecimal representation.

StringUtility::toHex( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to convert.

Return Value:

The hexadecimal representation of the input string.

StringUtility::fromHex

Converts a hexadecimal string back to its original form.

StringUtility::fromHex( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The hexadecimal string to convert.

Return Value:

The original string represented by the hexadecimal input.

StringUtility::toAscii

Converts a character to its ASCII value.

StringUtility::toAscii( string character ): int
  • This method is static. Parameters:
Parameter Type Description
character string The character to convert.

Return Value:

The ASCII value of the character.

StringUtility::fromAscii

Converts an ASCII value back to its corresponding character.

StringUtility::fromAscii( int ascii ): string
  • This method is static. Parameters:
Parameter Type Description
ascii int The ASCII value to convert.

Return Value:

The character represented by the ASCII value.

StringUtility::toFormat

Formats values into a string according to a specified format.

StringUtility::toFormat( string format ): string
  • This method is static. Parameters:
Parameter Type Description
format string The format string.

Return Value:

The formatted string.

StringUtility::fromFormat

Parses a string according to a specified format.

StringUtility::fromFormat( string string, string format ): array
  • This method is static. Parameters:
Parameter Type Description
string string The input string to parse.
format string The format string.

Return Value:

An array of parsed values.

StringUtility::toArray

Converts a string into an array of its characters.

StringUtility::toArray( string string ): array
  • This method is static. Parameters:
Parameter Type Description
string string The input string to convert.

Return Value:

An array of characters from the string.

StringUtility::toArrayWithSeparator

Converts a string into an array using a custom separator.

StringUtility::toArrayWithSeparator( string string, string separator ): array
  • This method is static. Parameters:
Parameter Type Description
string string The input string to convert.
separator string The separator to use for splitting the string.

Return Value:

An array of substrings created by splitting the input string.

StringUtility::fromArray

Converts an array of strings back into a single string.

StringUtility::fromArray( array array, string separator = "" ): string
  • This method is static. Parameters:
Parameter Type Description
array array The array of strings to join.
separator string The separator to use when joining.

Return Value:

The joined string.

StringUtility::toInteger

Converts a string to an integer.

StringUtility::toInteger( string string ): int
  • This method is static. Parameters:
Parameter Type Description
string string The input string to convert.

Return Value:

The integer value of the string.

StringUtility::fromInteger

Converts an integer back to a string.

StringUtility::fromInteger( int integer ): string
  • This method is static. Parameters:
Parameter Type Description
integer int The integer to convert.

Return Value:

The string representation of the integer.

StringUtility::toFloat

Converts a string to a float.

StringUtility::toFloat( string string ): float
  • This method is static. Parameters:
Parameter Type Description
string string The input string to convert.

Return Value:

The float value of the string.

StringUtility::fromFloat

Converts a float back to a string.

StringUtility::fromFloat( float float ): string
  • This method is static. Parameters:
Parameter Type Description
float float The float to convert.

Return Value:

The string representation of the float.

StringUtility::toBoolean

Converts a string to a boolean value.

StringUtility::toBoolean( string string ): bool
  • This method is static. Parameters:
Parameter Type Description
string string The input string to convert.

Return Value:

The boolean value represented by the string.

StringUtility::fromBoolean

Converts a boolean value to its string representation.

StringUtility::fromBoolean( bool boolean ): string
  • This method is static. Parameters:
Parameter Type Description
boolean bool The boolean to convert.

Return Value:

"true" or "false" based on the boolean value.

StringUtility::inRot

Encodes a string using ROT13.

StringUtility::inRot( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to encode.

Return Value:

The ROT13 encoded string.

StringUtility::ofRot

Decodes a string using ROT13.

StringUtility::ofRot( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to decode.

Return Value:

The ROT13 decoded string.

StringUtility::inSlashes

Escapes special characters in a string using slashes.

StringUtility::inSlashes( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to escape.

Return Value:

The escaped string with slashes.

StringUtility::ofSlashes

Unescapes special characters in a string.

StringUtility::ofSlashes( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to unescape.

Return Value:

The unescaped string.

StringUtility::inUU

Encodes a string using UU encoding.

StringUtility::inUU( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to encode.

Return Value:

The UU encoded string.

StringUtility::ofUU

Decodes a UU encoded string.

StringUtility::ofUU( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The UU encoded string to decode.

Return Value:

The decoded string.

StringUtility::inSafeCharacters

Converts special characters to HTML entities.

StringUtility::inSafeCharacters( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to convert.

Return Value:

The string with special characters converted to HTML entities.

StringUtility::ofSafeCharacters

Converts HTML entities back to their corresponding characters.

StringUtility::ofSafeCharacters( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string with HTML entities.

Return Value:

The decoded string with HTML entities converted back.

StringUtility::inHtmlEntities

Converts special characters to HTML entities with quotes.

StringUtility::inHtmlEntities( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to convert.

Return Value:

The string with special characters converted to HTML entities.

StringUtility::ofHtmlEntities

Converts HTML entities back to their corresponding characters with quotes.

StringUtility::ofHtmlEntities( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string with HTML entities.

Return Value:

The decoded string with HTML entities converted back.

StringUtility::hashMD5

Generates an MD5 hash of a given string.

StringUtility::hashMD5( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to hash.

Return Value:

The MD5 hash of the input string.

StringUtility::hashSHA

Generates a SHA-1 hash of a given string.

StringUtility::hashSHA( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to hash.

Return Value:

The SHA-1 hash of the input string.

StringUtility::hashChecksum

Generates a checksum for a given string using SHA-1.

StringUtility::hashChecksum( string string ): string
  • This method is static. Parameters:
Parameter Type Description
string string The input string to hash.

Return Value:

The hashed checksum of the input string.

StringUtility::validateChecksum

Validates a given string against a provided checksum.

StringUtility::validateChecksum( string string, string checksum ): bool
  • This method is static. Parameters:
Parameter Type Description
string string The input string to validate.
checksum string The checksum to verify against.

Return Value:

True if the string matches the checksum, false otherwise.

TypesUtility

Class TypesUtility

A utility class for type checking and conversion.

  • Full name: \PHPallas\Utilities\TypesUtility

TypesUtility::getType

Get the type of a variable.

TypesUtility::getType( mixed value ): string
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

The type of the variable.

TypesUtility::isArray

Check if the variable is an array.

TypesUtility::isArray( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is an array, false otherwise.

TypesUtility::isBoolean

Check if the variable is a boolean.

TypesUtility::isBoolean( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is a boolean, false otherwise.

TypesUtility::isCallable

Check if the variable is callable.

TypesUtility::isCallable( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is callable, false otherwise.

TypesUtility::isCountable

Check if the variable is countable.

TypesUtility::isCountable( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is countable, false otherwise.

TypesUtility::isFloat

Check if the variable is a float.

TypesUtility::isFloat( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is a float, false otherwise.

TypesUtility::isInteger

Check if the variable is an integer.

TypesUtility::isInteger( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is an integer, false otherwise.

TypesUtility::isIterable

Check if the variable is iterable.

TypesUtility::isIterable( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is iterable, false otherwise.

TypesUtility::isNull

Check if the variable is null.

TypesUtility::isNull( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is null, false otherwise.

TypesUtility::isNumeric

Check if the variable is numeric.

TypesUtility::isNumeric( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is numeric, false otherwise.

TypesUtility::isObject

Check if the variable is an object.

TypesUtility::isObject( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is an object, false otherwise.

TypesUtility::isResource

Check if the variable is a resource.

TypesUtility::isResource( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is a resource, false otherwise.

TypesUtility::isScalar

Check if the variable is a scalar.

TypesUtility::isScalar( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is a scalar, false otherwise.

TypesUtility::isString

Check if the variable is a string.

TypesUtility::isString( mixed value ): bool
  • This method is static. Parameters:
Parameter Type Description
value mixed The variable to check.

Return Value:

True if the variable is a string, false otherwise.

TypesUtility::to

Convert a variable to a specified target type.

TypesUtility::to( mixed variable, string targetType ): mixed
  • This method is static. Parameters:
Parameter Type Description
variable mixed The variable to convert.
targetType string The target type to convert to (string, int, float, bool, array, object).

Return Value:

The converted variable.

TypesUtility::toString

Convert a variable to a string.

TypesUtility::toString( mixed variable ): string
  • This method is static. Parameters:
Parameter Type Description
variable mixed The variable to convert.

Return Value:

The converted string.

TypesUtility::toInteger

Convert a variable to an integer.

TypesUtility::toInteger( mixed variable ): int
  • This method is static. Parameters:
Parameter Type Description
variable mixed The variable to convert.

Return Value:

The converted integer.

TypesUtility::toFloat

Convert a variable to a float.

TypesUtility::toFloat( mixed variable ): float
  • This method is static. Parameters:
Parameter Type Description
variable mixed The variable to convert.

Return Value:

The converted float.

TypesUtility::toBoolean

Convert a variable to a boolean.

TypesUtility::toBoolean( mixed variable ): bool
  • This method is static. Parameters:
Parameter Type Description
variable mixed The variable to convert.

Return Value:

The converted boolean.

TypesUtility::toArray

Convert a variable to an array.

TypesUtility::toArray( mixed variable ): array
  • This method is static. Parameters:
Parameter Type Description
variable mixed The variable to convert.

Return Value:

The converted array.

TypesUtility::toObject

Convert a variable to an object.

TypesUtility::toObject( mixed variable ): object
  • This method is static. Parameters:
Parameter Type Description
variable mixed The variable to convert.

Return Value:

The converted object.

Contributing

We welcome contributions! Please read our Contributing Guidelines for more information on how to get involved.

Changelog

All notable changes to this project will be documented in the CHANGELOG.md.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Created with ❤️ and dedication by PHPallas team! 🌟