dongyue4964 2011-05-21 18:11
浏览 107
已采纳

使用PHP显示基于CSV的图表

Sorry, I'm a n00b to web languages. I'm trying to upload a CSV file, parse the second and seventh columns, and output it to the Google Graphs API. This is my first ever time trying to do anything with PHP, so, a example would be nice for me to analyze, but, I can try to figure out everything with documentation as well.

Thank you so much for help in any way.

  • 写回答

3条回答 默认 最新

  • dougengqiu8031 2011-05-21 18:32
    关注

    here's how you can upload a file with PHP: http://de3.php.net/move_uploaded_file Parsing a CSV file is easy:

    $csv = file('path/to/file.csv');
    foreach ($csv as &$current) {
      $current = explode(';', $current);
    }
    

    If you then loop through $csv you have the second and seventh column in $csv[$iterator][1] and $csv[$iterator][6].

    I haven't used Googles Graph API, so I can't help you with that.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 寻找电脑攻防的导师,有问题请教一下。
  • ¥20 微信同是win11,我的电脑安装不了pageoffice,一直无法打开
  • ¥15 这个界面我通过postman请求不到,但是通过浏览器可以正常访问
  • ¥15 动态规划算法实现背包问题
  • ¥15 wpf程序使用过程中异常奔溃
  • ¥15 多目标优化算法在与其他算法数据对比结果判断
  • ¥15 CPTN和EAST,主干网络是VGG16,请问在ICDAR2015数据集上训练之后,CPTN和EAST模型的大小为多少
  • ¥15 按颜色进行点云分割-python
  • ¥15 Matlab如何实现汽车变道切入场景的批量仿真
  • ¥15 无刷电机要通过什么才能做各种动作