<?php
$file = fopen("[~nn~]" ’r’);
while ($row = fgetcsv($file, $length+1, $delimiter)) {
..
}
?>
You can use fopen() with MODx documents as it can take a URL as a file identifier
You will need to use the makeURL API function to get the URL of a document though - I’ve not got access to the code where I have done it at the moment but hopefully, I can post an example later on.
Cheers, Garry
$filename = $modx->makeUrl(99); $file = fopen ( $filename, "r");
$filename = 'http://www.mywebsite.com'.$modx->makeUrl(99);
$filename = sprintf("http://%s%s", getenv("HTTP_HOST"), $modx->makeUrl(99)); $f = @fopen($filename, "r"); if ($f) { while (!@feof($f)) { $output .= sprintf ("%s", @fgets ( $f )); } @fclose($f); }