PHP 7.0.6 Released

curl_file_create

(PHP 5 >= 5.5.0, PHP 7)

curl_file_createCreate a CURLFile object

Description

This function is an alias of: CURLFile::__construct()

User Contributed Notes

mipa
2 years ago
For PHP < 5.5:

<?php

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

?>
To Top