Тёмный

Beginner PHP Tutorial - 78 - File Handling: Reading a File 

thenewboston
Подписаться 2,7 млн
Просмотров 94 тыс.
50% 1

Source Code: github.com/thenewboston-devel...
Core Deployment Guide (AWS): docs.google.com/document/d/16...

Опубликовано:

 

19 апр 2011

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 72   
@richardgenck2692
@richardgenck2692 7 лет назад
These are GREAT!! I'm sharing this with my friends, you might want to rename this and the next video though, this one should probably be 79, and 79 should be 78.
@AnthonyVipond
@AnthonyVipond 10 лет назад
Keep in mind, file() does not work for large files as it reads it all into memory. Imagine using file() on 1 GB log files...
@anthonyrosamilia3498
@anthonyrosamilia3498 9 лет назад
I find one of the main issues in learning multiple languages is knowing when a standard function creates an array of data or another form of data. It makes you have to memorize so much!
@jasbirsingh1729
@jasbirsingh1729 8 лет назад
Your videos are great man. I did php in the college But my professor taught nothing. Only because of you I am good with PHP
@reshetech
@reshetech 13 лет назад
You have the best PHP tutorial on the net. Thank you so much!
@Weegee4458
@Weegee4458 10 лет назад
7:37 "oh dear.." xD
@Dutchmonkey
@Dutchmonkey 12 лет назад
For those who still haven't figured it out. Vid 78 and Vid 79 are switched.
@Robstercraw
@Robstercraw 10 лет назад
are these out of whack? in the last video no such form was created.
@McGavel1
@McGavel1 8 лет назад
Awesome man, thanks! I'm trying to make an online poker hand reviewer from a downloaded hand history text file and this is just what I needed. Gonna check out some other videos too. Peace and good luck.
@McGavel1
@McGavel1 8 лет назад
+McGavel1 PHP has so many sweet built-in functions - I love it.
@jesselisser
@jesselisser 9 лет назад
Haha love it!! Off by one error :D Great vid
@billgates4156
@billgates4156 9 лет назад
for those people finding this video confusing...its an uploading error..first of all watch tutorial 79 and come back..Makes sense
@johnjacob9225
@johnjacob9225 10 лет назад
Before u watch this watch 79.. Videos just got mixed.. Watch 79 then 78.
@Brax1982
@Brax1982 9 лет назад
How about not counting at all and instead using a string variable "s" on which you concatenate everything in the loop, then once the loop is done, remove the excess comma and maybe whitespace, then echo "s"?
@deepgagan9015
@deepgagan9015 7 лет назад
nice explanation alex sir !
@BBSKN
@BBSKN 11 лет назад
Instead of initializing $count to 1, you can increment $count before the if condition inside the foreach loop. Same effect, but some what more logical since 0 names have been cycled through before the loop begins.
@vu2arm
@vu2arm 6 лет назад
How to create sequence of file on directory in php while name are store in text file
@desmondloo9695
@desmondloo9695 6 лет назад
i face a problem where when i direct till the last folder ,it does not show the file i have in the folder but open the file straight
@technoooooofreak
@technoooooofreak 7 лет назад
All the pain he took to remove a trailing comma! Programming is indeed funny! xD
@rahulgaur7003
@rahulgaur7003 8 лет назад
clear concept .
@luqmanafridi333
@luqmanafridi333 8 лет назад
well good job SIR !!!!
@Capovila21
@Capovila21 9 лет назад
Thanks so much!
@xxiRaQiAtheistxx
@xxiRaQiAtheistxx 11 лет назад
Jump up one lesson more 79, and come back later to this one! lol
@VanyaD
@VanyaD 11 лет назад
Gosh, why isn't this stuff working for me?????? Only the form opens up, but no file is created or written into and my code is one by line the same as Alex's!!!
@bujunjeri1963
@bujunjeri1963 8 лет назад
cool tutorial bt my trim seems not to be working { echo trim($fname); }
@Ashbrringer
@Ashbrringer Год назад
The course is great! But it would be a good thing to rename this video to 79, because the Appending is done in the next one.
@REALCOOLLIKEVIPUL
@REALCOOLLIKEVIPUL 11 лет назад
Since you want to add "AND" after second last name, so you used readin_count-1. nice work
@shawnfrank1522
@shawnfrank1522 11 лет назад
increment count ++ before the if statement, then you can keep count 0 initially.
@melanshrestha6331
@melanshrestha6331 8 лет назад
can this be used for comment purpose in the website?
@namelast-name616
@namelast-name616 7 лет назад
yes i have a code which i found long time ago cuz i didn't knew hanything in php, but now i watch this tutorials and see how easily it was created
@Balaclavaz
@Balaclavaz 10 лет назад
When I echo out I get the word "Array" before the first name, which is replaced by a "1" when I do $count = 1. I don't know what I'm doing wrong to get that. The $count business seems a long winded way of removing a final comma
@Balaclavaz
@Balaclavaz 10 лет назад
fixed it; a stray comma instead of a semi-colon after echoing current name in field
@hassanbaiga
@hassanbaiga 12 лет назад
Sandra returned you with an error, she betrayed you man !!!!!
@gabrielkdc17
@gabrielkdc17 8 лет назад
Shouldn't you use httpentities?
@BrasiLIndomaveL
@BrasiLIndomaveL 12 лет назад
I wrote this, but I don't quite understand why it works. Somebody could explain to me? foreach($readin as $fname) { echo trim($fname); if ($count
@Gustavo81988
@Gustavo81988 12 лет назад
A little improvement would be: foreach($readin as $fname){ echo trim($fname); if($count
@shourabhpayal1198
@shourabhpayal1198 8 лет назад
THIS VIDEO IS LIL MESSED UP
@trueredexe
@trueredexe 11 лет назад
Indeed.
@ciaranwhyte4088
@ciaranwhyte4088 9 лет назад
if($count != $fileCount) { echo ', '; } That original code was perfectly fine, all he needed to do was change count to a 1
@dostmusician
@dostmusician 11 лет назад
tut-79 should come before this one(tut-78). watch that first,and then you would understand this one.
@MrMagnat86
@MrMagnat86 9 лет назад
OMG, maybe count++; must be before inner if.
@cjvaans4484
@cjvaans4484 10 лет назад
Wha!? What the heck did I miss!? Oh. Videos are just mixed up.
@baohuynh562
@baohuynh562 13 лет назад
Oh dear!
@trueredexe
@trueredexe 11 лет назад
After using JSP for all this php feels like childs play
@Martin870620
@Martin870620 12 лет назад
I paused the video and figure out the problem like this: if(($count + 1) < $readin_count){ echo ', '; } Which is the same thing but simply changing the variable to 1 is definitly the beter way to do this.
@tiradorphilippinez6149
@tiradorphilippinez6149 10 лет назад
nice tutorial , you've lean a lot if you stick in his lesson
@vyuutuube
@vyuutuube 9 лет назад
whuhahaha i tried to scroll the scrollbar of your video to look at your code below... am i the only one trying that by accident or do you people recognise this? :) :) :)
@zwich
@zwich 12 лет назад
@arvids817 ty saved some time ;D
@SuperSlashpwn
@SuperSlashpwn 12 лет назад
@andreyfschoier Thanks Mate :)
@hussi0o
@hussi0o 11 лет назад
because u need to write $_POST (not $_post)
@mmafanuk
@mmafanuk 10 лет назад
I have no idea what just happened
@mockingbird3809
@mockingbird3809 7 лет назад
If you not understand it first watch 79 before this
@tuananhha
@tuananhha 10 лет назад
Very difficult to understand!
@dibraniuk
@dibraniuk 5 лет назад
need do validation first
@mastermax7777
@mastermax7777 13 лет назад
@baohuynh562 lol
@Rashmeed
@Rashmeed 11 лет назад
This is a bad and slow way, use this: echo file_get_contents("names.txt");
@RahilWazirAli
@RahilWazirAli 12 лет назад
mistakes are made by humans, its okay!
@laurisskraucis2247
@laurisskraucis2247 10 лет назад
that isnt good to say that
Далее
Украшаю чехлы 🎀
00:51
Просмотров 222 тыс.
Working With PHP Arrays the Right Way
16:10
Просмотров 5 тыс.
PHP $_FILES and Handling File Uploads
19:36
Просмотров 6 тыс.
PHP file_put_contents - Add and Update a Text File
8:46
php file open read and close ||  php fopen function - 1
16:00