digphp/includer

php include from stream wrappers

1.0.0 2022-03-10 05:51 UTC

This package is auto-updated.

Last update: 2024-06-10 11:12:55 UTC


README

一个便捷的include的wrapper封装

安装

composer require digphp/includer

用例

方式一

<?php
$phpcode='hello <?php echo $name;?>';
$name='xiaoming';
include \DigPHP\Includer\Wrapper::write($phpcode);

方式二

<?php
$phpcode='hello <?php echo $name;?>';
\DigPHP\Includer\Wrapper::load($phpcode, ['name'=>'xiaoming']);