Welcome Guest, Not a member yet? Register   Sign In
Convert a single column of values into a comma seperated list
#13

[eluser]johnwbaxter[/eluser]
@xwero

I believe i have solved the problem. I borrowed a bit of code from the comments on fgetcsv on php.net and we now have:
Code:
$temp_csv = $_FILES['userfile']['tmp_name'];
                $content = file_get_contents($temp_csv);
                unlink($temp_csv);

                $ret = ereg_replace(chr(13) . chr(10),",",$content);
                $ret = ereg_replace(chr(13),",",$ret);
                //$str = explode("\n", $ret);
            
                echo $ret;

Which works on windoze and mac.

Thanks for all your help today, you've been great.


Messages In This Thread
Convert a single column of values into a comma seperated list - by El Forum - 09-22-2008, 08:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB