{"id":21,"date":"2009-12-01T14:03:28","date_gmt":"2009-12-01T12:03:28","guid":{"rendered":"http:\/\/www.karadere.com\/blog\/?p=21"},"modified":"2009-12-01T14:03:28","modified_gmt":"2009-12-01T12:03:28","slug":"dosya-okuma-txt-text","status":"publish","type":"post","link":"https:\/\/www.karadere.com\/blog\/dosya-okuma-txt-text.html","title":{"rendered":"Php ile Dosya Okuma (txt text)"},"content":{"rendered":"<p>Php ile dosya Okuma (txt text)\u00a0 A\u015fa\u011f\u0131daki \u00f6rne\u011fimizde\u00a0 root dosyadaki <strong>dosya.txt<\/strong> i\u00e7inin okunmas\u0131 ile ilgili \u00f6rnek mevcuttur. Fopen fonksiyonu ile dosya a\u00e7\u0131larak printe fonksiyonu ile sat\u0131r sat\u0131r yazd\u0131r\u0131yoruz.<\/p>\n<p>&lt;?<\/p>\n<p>\/*<br \/>\n$dosya_adi=&#8221;dosya.txt&#8221;;<br \/>\nif ($dosya=fopen(&#8220;$dosya_adi&#8221;,&#8217;r&#8217;))<br \/>\n{<br \/>\n$i=0;<br \/>\nwhile ($i &lt;= 5) {<br \/>\n$i++;<br \/>\n$satir=fgets($dosya,1024);<br \/>\nprint &#8220;&#8221;.$satir.&#8221;&lt;br&gt;&#8221;;<\/p>\n<p>}<br \/>\n}<br \/>\nelse<br \/>\nprint &#8220;Dosya a\u00e7\u0131lamad\u0131: &#8220;.$dosya_adi;<\/p>\n<p>*\/<br \/>\n$dosya = file(&#8220;dosya.txt&#8221;);<br \/>\nforeach ($dosya as $satsayisi =&gt; $satir)<br \/>\n{<br \/>\n}<br \/>\n$hedefsatir = $satsayisi\u00a0 &#8211; 5;<\/p>\n<p>\/\/print $hedefsatir ;<\/p>\n<p>foreach ($dosya as $satsayisi =&gt; $satir)<br \/>\n{<br \/>\nif ($hedefsatir==$satsayisi){<\/p>\n<p>print $satir;<\/p>\n<p>}<\/p>\n<p>}<br \/>\n\/*<br \/>\n$str = &#8220;Hello#world!&#8221;;<br \/>\n$bol = spliti(&#8216;#&#8217;,$str);<\/p>\n<p>print $bol[1];<\/p>\n<p>*\/<\/p>\n<p>?&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Php ile dosya Okuma (txt text)  A\u015fa\u011f\u0131daki \u00f6rne\u011fimizde  root dosyadaki dosya.txt i\u00e7inin okunmas\u0131 ile ilgili \u00f6rnek mevcuttur. Fopen fonksiyonu ile dosya a\u00e7\u0131larak printe fonksiyonu ile sat\u0131r sat\u0131r yazd\u0131r\u0131yoruz.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[83,41],"tags":[235,837,1677],"class_list":["post-21","post","type-post","status-publish","format-standard","hentry","category-php","category-programlama-software","tag-php","tag-dosya-okuma","tag-php-dosya-okuma","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"aioseo_notices":[],"views":3871,"_links":{"self":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/comments?post=21"}],"version-history":[{"count":0,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts\/21\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/media?parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/categories?post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/tags?post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}