Download the PHP package mekramy/php-util without Composer

On this page you can find all versions of the php package mekramy/php-util. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-util

Helpers And Utility Functions For PHP

Quick Switch

If you need to check many conditions to set a variable value you can use quickSwitch instead of deep ternary (?:), if/else or switch/case.

Quick switch simply accept a associative array of value => condition. if any of conditions is truly or return truly value, returned as result otherwise the default value will returned.

Convert Date To Persian Date

You can pass string date, DateTime object, Carbon instance or timestamp to parse as persian date.

Note: If you pass null as input date, this function return current date

Note If you pass null as format parameter, this function return \Hekmatinasser\Verta\Verta object instead of date string.

Note If invalid date passed as input this function return null

Convert Persian Date To Date

You can pass string persian date or \Hekmatinasser\Verta\Verta instance to parse as gregorian date.

Note: If you pass null as input date this function return current date

Note If you pass null as format parameter this function return \Carbon\Carbon object instead of date string.

Note If invalid date passed as input this function return null

Validate Value

Check if value not empty and is a valid value (if allowed list passed) or return default value if not valid.

Note Pass null as allowed values to ignore check

Validate Number

Check if value is a number and is in range (min/max) and is valid (allowed value) or return default.

Note If $float set to true $value parsed as float otherwise parsed as int

Note Pass null as allowed values to ignore check

Note Pass null as min/max values to ignore check

Convert Value To Boolean

If value is 1, "1", true, "true", "on" or "yes" return true otherwise return false

Extract Number From String

Format String With Placeholder

Print Debug Block

This function convert input variable to JSON pretty formatted and print to output using echo with headers and footer.

Note You can specify header text, separator character and header/footer length


All versions of php-util with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
ext-json Version *
nesbot/carbon Version >=2.30
hekmatinasser/verta Version >=1.10
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mekramy/php-util contains the following files

Loading the files please wait ....