LinkStack/app/Functions/externalfiles.php

18 lines
580 B
PHP
Raw Normal View History

<?php
function external_file_get_contents($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0');
$data = curl_exec($ch);
curl_close($ch);
return $data;
2023-05-25 18:00:00 +02:00
}
2023-05-25 18:15:16 +02:00
function uri($path) {
2023-05-25 18:09:25 +02:00
$url = str_replace(['http://', 'https://'], '', url(''));
2023-05-25 18:00:00 +02:00
return "//" . $url . "/" . $path;
}