PHPackages                             zeek/php-utils - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. zeek/php-utils

ActiveLibrary

zeek/php-utils
==============

A collection of functions that provide basic PHP utility functionality.

2.2.2(9mo ago)211.7k↓100%2proprietaryPHPPHP &gt;=7.0CI failing

Since Feb 28Pushed 9mo ago15 watchersCompare

[ Source](https://github.com/CodingIT-dev/php-utils)[ Packagist](https://packagist.org/packages/zeek/php-utils)[ RSS](/packages/zeek-php-utils/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (8)Used By (0)

PHP Utils
=========

[](#php-utils)

[![](https://github.com/ZeekInteractive/php-utils/workflows/Tests/badge.svg)](https://github.com/ZeekInteractive/php-utils/workflows/Tests/badge.svg)

Purpose
-------

[](#purpose)

Utility functions to help alleviate some common use cases.

### Safe Read

[](#safe-read)

```
safe_read( $item, $key )
```

Useful for accessing something without having to wrap it with `empty` or `isset` checks constantly.

Returns `false` if it's unable to find the item. Works with both objects and arrays.

### Is Constant True

[](#is-constant-true)

```
is_constant_true( $constant )
```

Checks the following in order:

- Constant is defined
- Constant is `true`

Helpful to avoid always having to check if the constant is defined before checking the value.

Returns either `true` or `false`.

### Get File

[](#get-file)

```
get_file( $filename, $extension )
```

Checks that the file exists and is readable.

Allowable file types are:

- xml
- sql
- txt
- json

Returns the data of the file or `false` if it failed.

### Recursively Remove Directory

[](#recursively-remove-directory)

```
rrmdir( $dir )
```

Recursively delete a directory and all files and directories inside it.

This is useful because PHP's `rmdir` does not delete a directory if anything exists inside of it.

### Format Currency

[](#format-currency)

Formats the given value with two decimal places, prefixed with a dollar sign.

```
format_currency( 1.5 )
// $1.50
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance58

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 95.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~544 days

Recently: every ~674 days

Total

6

Last Release

271d ago

Major Versions

1.0 → 2.02018-03-24

PHP version history (2 changes)1.0PHP &gt;=5.6

2.2.2PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ccbbf38682dffd105e547ab9ced04036a980e7c1a256466f249ecc9463eb92b0?d=identicon)[zeek](/maintainers/zeek)

---

Top Contributors

[![AaronHolbrook](https://avatars.githubusercontent.com/u/953022?v=4)](https://github.com/AaronHolbrook "AaronHolbrook (23 commits)")[![ivande](https://avatars.githubusercontent.com/u/3731417?v=4)](https://github.com/ivande "ivande (1 commits)")

---

Tags

packagephputilities

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/zeek-php-utils/health.svg)

```
[![Health](https://phpackages.com/badges/zeek-php-utils/health.svg)](https://phpackages.com/packages/zeek-php-utils)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
