Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php file_get_contents url

function get_content($URL){
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_URL, $URL);
      $data = curl_exec($ch);
      curl_close($ch);
      return $data;
}

echo get_content('http://example.com');
Comment

file_get_contents with url

<?php

$curl_handle=curl_init();
curl_setopt($curl_handle, CURLOPT_URL,'http://###.##.##.##/mp/get?mpsrc=http://mybucket.s3.amazonaws.com/11111.mpg&mpaction=convert format=flv');
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Your application name');
$query = curl_exec($curl_handle);
curl_close($curl_handle);

?>
Comment

PREVIOUS NEXT
Code Example
Php :: old value in laravel 
Php :: get index of element in array php 
Php :: how to check if username already exists in php 
Php :: for loop in php 
Php :: php echo html response code 200 
Php :: last login date time in wordpress 
Php :: using a php array in jquery 
Php :: laravel convert datetime to date 
Php :: laravel get random row 
Php :: php artisan migrate --env=testing 
Php :: string to double php 
Php :: remove every whitespace php 
Php :: php mysql create table 
Php :: get env app url laravel 
Php :: date between query in codeigniter 
Php :: Your Composer dependencies require a PHP version "= 7.3.0" 
Php :: php get uploaded file extension 
Php :: php exit foreach 
Php :: php get time in milliseconds 
Php :: replace _ with space php 
Php :: wordpress add class on navigation menu 
Php :: get_template_part parameters 
Php :: unique value when two columns laravel migration 
Php :: php default timezone 
Php :: php header 500 
Php :: call table name in model laravel 
Php :: php artisan serve a folder 
Php :: laravel dropIndex 
Php :: string date less than now php 
Php :: php random float number with 2 decimal places 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =