PHP Classes

Examples of Useful PHP Functions from the Package PHP Utility Functions: General-purpose utility functions

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-04-26 (5 months ago) RSS 2.0 feedNot enough user ratingsTotal: 63 All time: 10,429 This week: 30Up
Version License PHP version Categories
php-util 1.0.0MIT/X Consortium ...5PHP 5, Data types, Global
Description 

Author

This package provides general-purpose utility functions.

It provides a set of functions to manipulate strings and arrays.

Currently, it can:

- Encode text as HTML

- Validate E-Mail address

- Return the current date and time in the ISO format

- Return a UUID v4 string

- Return array elements given the element path in the dot notation format

- Encode an array in JSON format

- Decode a JSON string

- Encode a string or array of values in UTF-8 encoding

- Decode a string or array of elements that use ISO-8859-1 encoding

- Include a PHP script and return the values defined in the script

Picture of Chun-Sheng, Li
  Performance   Level  
Name: Chun-Sheng, Li <contact>
Classes: 36 packages by
Country: Taiwan Taiwan
Age: 31
All time rank: 21066 in Taiwan Taiwan
Week rank: 22 Up1 in Taiwan Taiwan Up
Innovation award
Innovation award
Nominee: 16x

Winner: 1x

Instructions

Congratulations on your package.

We suggest you include simplified instructions on using your package to increase the number of interested users.

To do that, please click the Edit button on your package page and enter the instructions text in the Instructions field.

You can use the Markdown format to enter your instructions.

Then click the Update the class button to save the instructions. You can see the instructions on your package page.

Documentation

util

PHP functions

Installation

composer require odan/util

Functions

  • html - Convert all applicable characters to HTML entities.
  • is_email - Validate a E-Mail address
  • now - ISO date time (Y-m-d H:i:s)
  • uuid - Returns a `UUID` v4 created from a cryptographically secure random value
  • array_value - Return Array element value, with dot notation.
  • encode_utf8 - Encodes an ISO-8859-1 string or array to UTF-8.
  • encode_iso - Returns a ISO-8859-1 encoded string or array
  • read - Read a php file

  Files folder image Files (8)  
File Role Description
Files folder imagesrc (1 file)
Files folder imagetests (1 file)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file build.xml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (8)  /  src  
File Role Description
  Accessible without login Plain text file util.php Aux. Auxiliary script

  Files folder image Files (8)  /  tests  
File Role Description
  Plain text file UtilTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:63
This week:0
All time:10,429
This week:30Up