{"id":570,"date":"2010-05-23T13:35:41","date_gmt":"2010-05-23T12:35:41","guid":{"rendered":"http:\/\/www.dotmana.com\/index.php\/?p=570"},"modified":"2010-05-23T13:35:41","modified_gmt":"2010-05-23T12:35:41","slug":"php-fgets-doesnt-detect-end-of-line","status":"publish","type":"post","link":"https:\/\/www.dotmana.com\/weblog\/2010\/05\/php-fgets-doesnt-detect-end-of-line\/","title":{"rendered":"PHP fgets doesn&#8217;t detect end of line"},"content":{"rendered":"<p>If you parse some files, you can get an issue with fgets not detecting end of lines&#8230;<\/p>\n<p>In my case, files come from mac users, so I have to enable this option :<\/p>\n<blockquote><p>ini_set(&#8216;auto_detect_line_endings&#8217;, true);<\/p><\/blockquote>\n<p>Php documentation here : <a href=\"http:\/\/us2.php.net\/manual\/en\/filesystem.configuration.php#ini.auto-detect-line-endings\" target=\"_blank\">http:\/\/us2.php.net\/manual\/en\/filesystem.configuration.php#ini.auto-detect-line-endings<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you parse some files, you can get an issue with fgets not detecting end of lines&#8230; In my case, files come from mac users, so I have to enable this option : ini_set(&#8216;auto_detect_line_endings&#8217;, true); Php documentation here : http:\/\/us2.php.net\/manual\/en\/filesystem.configuration.php#ini.auto-detect-line-endings<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-570","post","type-post","status-publish","format-standard","hentry","category-dev"],"_links":{"self":[{"href":"https:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts\/570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/comments?post=570"}],"version-history":[{"count":1,"href":"https:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts\/570\/revisions"}],"predecessor-version":[{"id":571,"href":"https:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts\/570\/revisions\/571"}],"wp:attachment":[{"href":"https:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/media?parent=570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/categories?post=570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/tags?post=570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}