I am working on Wordpress and I know nothing about PHP . I am trying to get a post-excerpt scroller to work, but it uses fopen() , but it is disabled on my clients host.
PHP
fopen()
$f = fopen( $url, 'r' ); while( $data = fread( $f, 4096 ) ) { $xml .= $data; } fclose( $f );
Can this just be written in curl?
Thanks in advance!
it should work
$xml = file_get_contents($url);
$ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close ($ch);
Source: https://habr.com/ru/post/1435361/More articles:Java String.getBytes ("UTF8") JavaScript equivalent - javaSymfony2: Why weren't query string parameters included in the routing component? - symfonyCopy a chart from one sheet to another using the target sheet data for the chart in Excel - excel-vbaHow can I get a key object from a value? Is there something like array_search for objects? - objectWhat is the practice of scheduling multiple interconnected SQL Server Agent jobs? - sqlGroup Excel rows based on similar values ββusing VBA - vbaFailed to get Javascript Dajaxice syntax file - javascriptPave the way to build a project through the eclipse plugin - eclipse-pluginWhy is Directory.GetFiles () faster on subsequent launches? - performanceWill JUnit run a parallel test? - javaAll Articles