Skip to content

Instantly share code, notes, and snippets.

View smart--petea's full-sized avatar

Badarau Petru smart--petea

View GitHub Profile
@maxivak
maxivak / __upload_file.md
Last active March 21, 2026 03:44
PHP upload file with curl (multipart/form-data)

We want to upload file to a server with POST HTTP request. We will use curl functions.


// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");

// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");
@MustafaMagdi
MustafaMagdi / Container.php
Last active October 20, 2025 10:11 — forked from tlikai/container.php
PHP Dependency Injection Container
<?php
/**
* Class Container
*/
class Container
{
/**
* @var array
*/