Skip to content

Instantly share code, notes, and snippets.

@Krknv
Last active February 2, 2018 06:31
Show Gist options
  • Save Krknv/2a15866089f40e7f82eb8c4762a15c55 to your computer and use it in GitHub Desktop.
Save Krknv/2a15866089f40e7f82eb8c4762a15c55 to your computer and use it in GitHub Desktop.

polyfill for curl_file_create

if (!function_exists('curl_file_create')) {
    function curl_file_create($filename, $mimetype = '', $postname = '') {
        return "@$filename;filename="
            . ($postname ?: basename($filename))
            . ($mimetype ? ";type=$mimetype" : '');
    }
}

http://php.net/manual/ru/function.curl-file-create.php#114538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment