Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在不使用 fopen 的情况下将字符串转换为输入流?由于公司政策不允许在服务器上使用 fopen,我有点震惊。
我正在使用这个:
$string = "abcdef"; $stream = fopen('data://text/plain,' . $string,'r');
先感谢您
不知道这是否有效,还没有测试过,但是如果你这样做:
ob_start(); include('files/path'); $file_string = ob_get_clean();