Search
 
SCRIPT & CODE EXAMPLE
 

PHP

file get content php post

$postdata = http_build_query(
    array(
        'val1' => 'val1',
        'val2' => 'val2',
    )
);
$url = "your_post_url";

function post($url, $postdata){
    $opts = array('http' =>
        array(
            'method'  => 'POST',
            'header'  => 'Content-Type: application/x-www-form-urlencoded',
            'content' => $postdata
        )
    );
    
    $context  = stream_context_create($opts);
    $result = file_get_contents($url, false, $context);
    return $result;
}

print_r(post($url, $postdata));
Comment

PREVIOUS NEXT
Code Example
Php :: laravel merge two arrays helper 
Php :: how to get the previous page url in php 
Php :: multe data on database laravel 
Php :: laravel pagination 
Php :: defining constant in config laravel 
Php :: remove space and line from json in php 
Php :: laravel get from model 
Php :: php unit expect exception 
Php :: Laravel return empty relationship on model when condition is true 
Php :: laravel new line in session flash message 
Php :: laravel sanctum 
Php :: language_attributes for wordpress 
Php :: show uploaded image in php 
Php :: laravel relation with limit 
Php :: how check the time of operation in laravel 
Php :: php to print value if key exists in array 
Php :: install all php extensions ubuntu 20.04 
Php :: yii2 sendemail extension 
Php :: php string variable 
Php :: php if in database field exists, if exists update, if not create 
Php :: laravel collection contains 
Php :: php reload after env 
Php :: change wordpress viewport 
Php :: Laravel 9 Mail File 
Php :: guzzlehttp submit form file 
Php :: laravel copy image 
Php :: substr last 3 characters 
Php :: laravel install 
Php :: str_contains php 5 
Php :: bulk update data in db query in laravel 8 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =