Hi all, i am using this code to write csv file. ================================================ function csvwriter($filecontents=null){ error_reporting(E_ALL ^ E_NOTICE); $arr = $_SERVER["SCRIPT_FILENAME"]; $arr2 = explode("/",$arr); $fruit = array_pop($arr2); $path = implode("/",$arr2)."/"; $fp = fopen($path.'logfile.csv','w'); //pr($filecontents); foreach ($filecontents as $line) { fputcsv($fp,split(',',$line)); } fclose($fp); return true; }//end function. ======================================================= But i am getting this below error.However it is inbuild php function.Anybody can give me suggestion for it. Fatal error: Call to undefined function fputcsv() in /var/www/html/pnet/app/webroot/Autodownload/cronjob/lib.php on line 1008
Kaizoku is right. If you have to use the older version of PHP, follow the link that Kaizoku gave and check the first comment on the page: it has an implementation written in PHP for older versions.