<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hnw</author_name>
  <author_url>https://blog.hatena.ne.jp/hnw/</author_url>
  <blog_title>hnwの日記</blog_title>
  <blog_url>https://hnw.hatenablog.com/</blog_url>
  <categories>
    <anon>PHP</anon>
  </categories>
  <description>さて、前回記事「PHPでメモリ上に一時ファイルを作る」では、file_get_contents関数でCSVファイル全体を取得して文字エンコーディングの変換を行い、変換結果に対してfgetcsv関数を利用しました。しかし、CSVファイルが巨大な場合にはfile_get_contentsを使うとメモリ上限に引っかかってPHPが停止してしまいます。 もちろん、UTF-8のCSVファイルに対してfgetcsvを利用するのであれば、どんな大きなCSVファイルだろうと処理することが可能です。なぜなら、fgetcsvはファイルを1行単位で読み込む関数ですから、1行分のメモリ消費だけでファイル全体を読み込み続…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhnw.hatenablog.com%2Fentry%2F20090317&quot; title=&quot;巨大なSJISのCSVファイルをfgetcsv関数で処理する - hnwの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2009-03-17 00:00:00</published>
  <title>巨大なSJISのCSVファイルをfgetcsv関数で処理する</title>
  <type>rich</type>
  <url>https://hnw.hatenablog.com/entry/20090317</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
