Include code from a PHP stream

后端 未结 4 484
旧巷少年郎
旧巷少年郎 2021-01-06 18:16

I\'m wondering if it is at all possible to create a stream wrapper in order to load some code from an array into using something like the following



        
4条回答
  •  一整个雨季
    2021-01-06 18:39

    I know this is an old question...but I think it's worth noting that you can do something like:

    $content = '
      
        print this html
      
    ';
    

    Normally this would very cumbersome to eval, but you can do:

    include "data://text/plain;base64,".base64_encode($content);
    

    And it will parse it snappy like!

提交回复
热议问题