PHPackages                             codersalman/include-with-variables - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. codersalman/include-with-variables

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

codersalman/include-with-variables
==================================

A library that includes a file with variables

v2(2y ago)07MITPHP &gt;=5.6

Since Jan 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/codersalman/includeWithVariables-composer-package)[ Packagist](https://packagist.org/packages/codersalman/include-with-variables)[ RSS](/packages/codersalman-include-with-variables/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Include With Variables
======================

[](#include-with-variables)

This is a PHP library that allows you to include a file with variables. It is compatible with PHP versions 5.6 and above.

Installation
------------

[](#installation)

You can install this package via Composer:

```
composer require codersalman/include-with-variables
```

Usage
-----

[](#usage)

To use this library, you need to call the includeWithVariables function with the file path and the variables you want to include. Here is an example:

```
$variables = ['var1' => 'value1', 'var2' => 'value2'];
$content = includeWithVariables('path/to/your/file.php', $variables);
```

In this example, path/to/your/file.php is the path to the file you want to include, and $variables is an associative array of the variables you want to include in the file. The function will return the content of the file as a string.

If you want to include a file without any variables, you can simply call the include function:

```
$content = includeWithVariables('path/to/your/file.php');
```

License
-------

[](#license)

This library is open-sourced software licensed under the MIT license.

Credits
-------

[](#credits)

- [Salman](https://github.com/codersalman)

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

897d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/107bf480feb3c84eda4945da4244deff33d1f2c2fde9c0595dea95081e5416fb?d=identicon)[codersalman](/maintainers/codersalman)

---

Top Contributors

[![imselmon](https://avatars.githubusercontent.com/u/83803180?v=4)](https://github.com/imselmon "imselmon (3 commits)")

### Embed Badge

![Health badge](/badges/codersalman-include-with-variables/health.svg)

```
[![Health](https://phpackages.com/badges/codersalman-include-with-variables/health.svg)](https://phpackages.com/packages/codersalman-include-with-variables)
```

PHPackages © 2026

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