xiaozi 2020-07-12 09:30:34

php获取tempfile路径

<?php

function tmpfilepath() {
    $path = stream_get_meta_data(tmpfile())['uri'];

    register_shutdown_function(
        function () use ($path) {
            unlink($path);
        }
    );

    return $path;
}

评论

首页 - Wiki
Copyright © 2011-2024 iteam. Current version is 2.123.1. UTC+08:00, 2024-03-02 19:18
浙ICP备14020137号-1 $访客地图$