php save to csv file

前端 未结 3 1758
失恋的感觉
失恋的感觉 2021-01-28 03:10

I\'m wanting to store basic data from a single form box and I\'ve created this php code base, but it doesn\'t seem to be working. Can someone take a glance and see if anything

3条回答
  •  野性不改
    2021-01-28 03:44

    This part will not behave like you expect, the variables are not evaluated when inside single quotes:

    $cvsData ='"$name","$date"'.PHP_EOL;
    

    You will need to use double quotes:

    $cvsData ="\"$name\",\"$date\"".PHP_EOL; 
    

提交回复
热议问题