codersalman/include-with-variables
最新稳定版本:v2
Composer 安装命令:
composer require codersalman/include-with-variables
包简介
A library that includes a file with variables
README 文档
README
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
You can install this package via Composer:
composer require codersalman/include-with-variables
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
This library is open-sourced software licensed under the MIT license.
Credits
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-19