First I did this project myself without using file system, just randomly generating all data I needed. Then remaked it following all your steps in this video and googled each moments, functions which I could not understand. Thank you so much, I learned a lot !
This whole series is indeed an awesome one. I have well over 5 years experience with PHP, but it feels so good to refresh the memory with the basics and learn some newly introduced features. My target is the advanced section… Especially Unit Test Thanks so much Gio 🙏. You’re blessed.
Sir you really go into depth when explaining the php syntax and concepts but I think you should also do the same in your projects,try to explain what your code is doing so its easy to follow through because it really gets tricky especially for beginners like us
I think what the gentleman is experiencing is the gaps in his own knowledge. The only solution for that @mmelimahlobo7656 is to note down what you don't understand and either go back to one of the videos where that concept is explained, or look it up online and try to put it to practice yourself. Bonus tip: don't worry about messing up, just try and try until it clicks.@@ProgramWithGio
I started learning Php almost at the end of February 2022. I even built a small personal site with it but now I see I've been learning it the wrong way. I could barely tell my left from my right attempting this exercise. Had to jump and watch the solution *coveringmyface*. I really need to go over the functions and array tutorials again mehn!. Your solution... I was intimidated (i mean this is a good way). I will press on. I need to sit-up. Thanks a whole lot Gio.
Don't worry, you got this. Also there are many ways to solve the problem so my solution isn't the only one. It can be done other ways as well that are also right. So I wouldn't worry about it. Just keep practicing. Good luck 🙌
@@ProgramWithGio Thanks alot Gio. This is a benchmark moment for me. Discouraged but I need to press on. Thanks a lot for the encouragements, I really need it. I don't think I should move on till I've really understood callback functions, anonymous functions and how arrays work. More grease to your elbow Gio
Your solution was more succinct and elegant than mine 😉 I can see where I need to trim stuff. I used for loops instead of foreach, but I can see how foreach is a much better option in this case. I ended up summing up my totals during each iteration while building the transaction array. I was calling another function to aggregate the totals within the function that was building the transaction array. I was thinking this might be saving time (processing?) if I only looped through it once. In the end, I see the value of having a function be more atomic in terms of what it is expected to do. It was kinda turning into the "everything" function. 😆 I will refactor the code more for the next project. The reason I am trying to learn PHP is I have to rewrite a Joomla component that has been abandoned. As no one else has created a component with its similar functionality for the latest Joomla release (which uses PHP v8), I've decided that I would be that person. The component uses the MVC pattern, which this latest project in a way is alluding to. Given what I've seen during Section 1, I feel confident that I will be able to do this once I've completed your course. I've already put to use what I've learned in the real world thought! 😃I had a bunch of mp3 files, in separate folders, that I needed to display on a page using the HTML5 tag. With what you'd taught to date, I was able to do it without any issues. It really felt like an accomplishment. 🙂 Otherwise, I would have had to type out all the file paths and titles by hand. Given there were hundreds of MP3 files, being able to use procedural PHP to do this saved me a lot of time. As you have likely noticed, I'm basically a n00b when it comes to programming anything. But this course is giving me a lot of confidence, so thank you again! 🙂
That is really awesome. Great job! Most important thing is you got it working, you can always make it better & clean it up. Love that you are applying what you learned to solve problems, that is amazing and kudos to you. You got the right mindset and are doing everything right so I am confident you will build great things. Good luck 🤞
I have watched this over and over and I don't seem to understand it, but I will give it some time, I Know I will grab a hold of it soon. Thank you Gio, you are a wonderful teacher and person
Don't worry about it. Take it slow and take a break. Thank you and good luck. If you have specific questions feel free to ask me either here or message me on Twitter
...and still the best PHP tutorial for experienced programmers. The parts that I enjoyed most: i) the callable function as a parameter hence making the code more reusable/universal, ii) Enforcing of strict type and type hinting, iii) array destructuring The tutorial playlist is great, may be a bit challenging for new programmers e.g the intuitive feeling that a certain function should be a helper function other than a business logic function. All in all, this is great, many thanks.
Thank you 💙💙. Intuitive feeling about certain functions is not expected, this is just my version of the solution but I think as long as beginner implements a working solution for this exercise regardless of what it looks like, I would say it's a success.
As someone who is classified as a beginner in Programming, for me this is already too advanced. Until now, I have watched 31 videos and while I understood most of the concepts, I never really got to use anything until now. With this being the first project, I couldn't even know where to start. Within the first 2 min of the video I knew right away this is way over my head and I never stood a chance. I do enjoy how Gio teaches in these videos but unfortunately I am going to be searching for a more beginner friendly course with more exercises along the way. Maybe one day when I am intermediate or advanced I can revisit this series. Good luck to everyone on the PHP learning journey!
Hey, that's normal. Everyone learns at different pace & different ways. I completely understand. Good luck on your journey, feel free to reach out with any questions 🙌. Thank you for the feedback 💙
I would recommend CodeAcademy, you got some solid basic there.. and to be honest All tutorial online are repeating over and over the same. Come back here After.. cause GIo is for me the only tutorial I ran into that deliver an incredible amount of great infos. you wont find anywhere else. but you will struggle a bit at first but need time to digest go over and write some notes.. :) the project I failed to make it fully but i got some stuff running. I went into his detailed correction and search for explanation on it :) and i nail the logical. my code is Messy and i need to google for funtionalities but i guess coder are all like that lol.. repetition and patient will make us the Masters :) ... Thanks again Gio :)
tada finally done few days ago i completed all the prev 30 videos and jumped on the project at that time i felt it was over for me i couldn't understand even a single line but then i started again from the tutorial 1 and this time investing a lot of time on every single video , a lot of time and now this project not i completed myself but after watching the solution to it i learned a lot of new stuff and everything seems so perfect ...thankk youuuu so much
I wrote that program result in same output but your code is well organized, meaningful function name, extendable really nice. i think that is the difference between junior and senior developer , i get many knowledge how to write good program only in single video. really high quality lesson sir. sorry for my english expression.
And that is perfectly normal, also everyone has different style. You'll get better at it with practice. Thank you & glad you did the exercise, good job 💙
I did it my own way before watching this video! My code is ofcourse has terrible quality, ofcourse I googled a lot, but it my first steps in programing. I didn't know anything about php and html before. Only one flow - i can't make horizontal dividing lines, other stuff (such as color change, calculation, output with "$" and "-$", date format and so on) is working. Thank you so much master Gio! Now time to watch how experienced programmer do the task and learn from it, moving forward the course. God bless you and all you love!
Okay so I tracked back and went over some of the videos again especially the arrays, working with arrays and the callback functions and anonymous functions etc. I understand it a lot more now. I'll move on in the course. Thanks a lot Gio
Even if I didn't understand everything ,Thank you so much. I have been struggling with php for over a month to find some resources until I found this channel. I will try to finish the playlist before 2022. I wish you a happy new year.
Thank you 💙💙. Feel free to ask questions if something was confusing, I'll be happy to clarify & clear things up. Don't rush, take your time. Thanks again and I wish you a happy new year as well 🎄
the project's instructions were too ambiguous for me especially instructions 2 & 3, but after watching this, I understand it now. this was short but such an informative video. the explanation would require me to watch it a couple of times before I get the hang of it and finally do it on my own. but still, glad I finally finished the first part
I love the way you teach and really appreciate your efforts. I have followed all lessons and learned too much as a beginner. Everything is great and well-structured, but for this project which is the practical one, it would have been better if you had started everything from scratch without prepared files and folders. Because for beginners like me, it is so difficult to follow along and understand everything with the premade folders and files, especially the connection between these files. Thank you very much.
@@ProgramWithGio Thank you very much. Actually, today I read the file called README and most of my concerns (problems) are solved now. Thank you for the nice and complete guidance there in the mentioned file.
@@ProgramWithGio Thank you very much. Yes, I have recently started learning PHP and I am strictly following all these episodes. ABOUT MY PROBLEM: In fact, after studying the README file, my problems were resolved, because everything was explained very well and perfect.
I hope you’re doing well! I really enjoy your content, especially the PHP & Laravel series. I believe a series on WordPress core development, focusing on plugins and theme development, would be incredibly valuable. Your expertise would provide great insights for many of us looking to enhance our skills.
I'm so happy that I could finish the project alone, without wiewing the answer! My code works, but is kinda "bloated". I've got a lot to improve, anyway, thanks for the course, it is much better than a lot of paid ones. :)
It's so nice to find that my initial soluition for the exercise was somewhat close to what you've done in this video, except it was not so flexible and i formatted dates and amounts right in the view file which looked messy. You're a great teacher Gio. Btw i think for multiple files we need some way of sorting the final transactions array by date.
Was good for first ever coding experience, done myself 2/3 of this app. My code, of course, VERY ugly and cant process some steps from your guide(i stuck on 'reading all files from directory' feature), and formatting done by me was too dummy, but i really glad to have this experience, doing by myself as many as possible on this step of learning, tries to less use google and etc., seems a good way. After watching this video, solution from sensei, gonna rewrite my code and get close to right realization. Thanks a lot, Gio!
Gio, that was a really high quality exercise, I am impressed! Helped me to put into practice some of the concepts from previous videos that I had been less familiar with. Huge thumbs up. I haven't touched getting files in over a decade probably, and had always struggled with callback/anonymous functions. So I practiced with array_filter to get all positive values to sum, and all negative values to sum (for the totals). I also used array_map and array_column to strip all the currency symbols in one go, but did revise it after watching your solution as parsing the data at the point of reading does make more sense. Maybe an improvement to doing separate functions for different banks would be to parse the headings row ;) Some banks may return way more columns than needed, for example, or switch up how they send their statements. Learnt a lot from working on the exercise, plus from comparing it to your solution. Thanks!
I struggle in figuring out the best way to learn. I've been programming for a little while now in college and it still seems like I know nothing. I had to watch some of your solutions to this when I couldn't figure it out. Is this the best way to learn? Following a tutorial and coding along with the instructor? I drive myself crazy trying to figure out how to become proficient. Good thing is I understand it once I see it, but that's the problem, I feel like I need to see it first. Great class so far though.
Yes that is the best way to learn, watch tutorials & code along. Its perfectly normal in the beginning to not know what to do and understand it after you've seen it. It comes with practice, the more you practice the more you'll know what to do in future. You got this 💪
Thank you so much for this tutorial Gio! You've done absolutely awesome job! Even if, I'm not totally convinced by php (maybe just not yet? 😉), I really appreciate your effort. It's not easy for me to get the feel of php but I have tried to play with it a bit and this is what I came out with in terms of colouring the transaction amount without if's:
In 3:50 , when you changed the getTransactionFiles function in a way that it gets inputs, there is a difference. Before the output was just the name bur now the output us the full address . I don't get it why
We are passing the path as an argument & are prepending it to the file so that way the file is a full path & not just a filename. Before it was just a filename because we were hardcoding the FILES_PATH constant but now it can be different.
Thank you very much for this course! I am really amazed how professionally this course is done! However, I would like to ask about the float numbers in the solution of the exercise. You've mentioned in one of your videos before that while working with the float numbers, you have to be very carefully due to their precision issues. So, in this exercise, wouldn't it better to multiply each amount by 100, do calculations (an addition or extraction) and before displaying the final numbers, divide them by 100?
Thank you 💙. In general I would agree, handling monetary values with float type can be dangerous. Better to use objects to represent Money & strings with bcmath. Since this is first section & beginner friendly I didn't want to overwhelm/confuse anyone by using objects & bcmath since objects is part of 2nd section.
Nice to find this great course and thoroughly enjoying it so far and want to thank you for your efforts. Job well done sir. but I didn't understand some part in this video (Building Small Part Of The App With Procedural PHP - Full PHP 8 Tutorial) i will be glad if i can get some explanation on it
Sir would you kindly explain what you just did there when defining your constants,I am a bit puzzled by the concatenation you made on the values of the constants,what does the directory separator achieve?
Can you point me to a specific timestamp? If you are talking about the directory separator constant that just basically adds proper "/" regardless of on which OS it is used on. Technically, you don't even need to use that constant, you can just use "/" and will still work in most if not all cases
I have some questions: 1. Was there video on your channel about callbacks in first part of course? (I didn't understand this fragment in 12:15 where you used ?callable) 2. Was there video on your channel about "handlers" in php, for what they are etc.? I often hear this term, but I don't know what it means exactly. 2. What this "?" (question mark) which I asked about in first question means? Right before "callable". 3. In about 12:39 - You assigned "$transaction" which is read row of CSV to "$transactionHandler($transaction);", it's line 35 at that moment of video. And right under, there is an assignment to "$transactions[]" array. My question is: Do we have to do it like this? I mean, in my code in pleace of your line 35 I just assigned my $transactions[] array straight to $transactionHandler($transaction). It looks like this: "$transactions[] = $transactionHandler($transaction);". With it I have one line less of code, but I wonder if it can be a mistake? That's why you didn't do it like that in your video. At the end sorry for my English if there are mistakes. I'm not fluent speaker.
1. Yes we did, check the outline repo (link in description) or the playlist and you should be able to search and find the video 2. This is used interchangeably for different purposes. Handler is something that handles/performs a task or a job. Error handler is something that handles errors, exception handler is something that handles exceptions & so on. Transaction handler in the context of this video simply handles the data extraction from transaction row 3. Transactionhandler can be null, thats why we first check if its null or not, if its not null we call it & then add to array, if its null we just add the transaction record to the array
using callables is awesome thank you for this. 2 quick questions : 7:12 is a second foreach bad practice to avoid using the keys ? 8:30 array_combine using keys from first row VS array deconstruction ?
Nope not a bad practice, it's just you don't always know the size of inner array, it may also be associative arrays with string keys. About array combine, not sure I understand, what would you be combining can you show me an example? There are many ways to do things as long as it works 🙂
@@ProgramWithGio when parsing the csv : I used array_combine using the first row of the csv for each line, and sent that array to extractTransaction and used 'Amount' as key for the str_replace. (when parsing csv I like to use associative array using the column name when possible) It works but seeing all I already learned in the basic part of this tutorial ( first time I see array deconstruction ) I wanted to make sure what is best practice. thank you again,
@@DAG_r8 either way works. There is no right or wrong in this case. One thing I would note is that you are relying on the column names which can change and can cause errors later. That's why I explicitly define the keys
Hi Gio, Thank you for the excellent tutorial. I am currently learning PHP and have covered all the basic topics such as Array methods, functions, loops, and variables. However, I am still finding it difficult to understand the implementation of projects. Can you provide any suggestions or tips that can help me better understand the project?
Hey, it's normal, everyone learns different ways so don't worry about it. I would say do more practice, even if you don't understand it. Working on a project will help you understand things, if you don't understand something research that specific topic, read documentation, then go back to your project & continue. Best way to learn is by building things.
please teacher , Can you answer me about this question >> in the view / transactions file , how did the php code take the data from sample.csv file without writing any line or sentence that point to HTML file to take the data from Excel file ?
In this solution we are not taking the file from HTML, we are reading a local directory and getting the CSV file from there. File uploads are covered in second section
This series is like a goldmine. I did complete the Simple Calculations project twice. I can't do the project without watching the video once in a while. Now in this situation will it be ok to watch the second section tutorial?
fgetcsv returns the row from csv & moves pointer to the next row, we are calling fgetcsv and are not assigning to a variable & not doing anything with it so essentially it just gets discarded & pointer is still moved to the next row.
Scans the directory for files & adds each file to the array which then gets returned. Notice that it skips any sub directories, thats what the if conditional check does.
Hello Gio, first time in my life i did file handling. I have one question in the code for calculating Totals function calcTotal(array $records):array { $totals = [ 'total_income'=>0, 'total_expence'=>0, 'net_total'=>0 ]; foreach ($records as $record) { $totals['net_total'] += $record['amount']; // This line is adding and subtracting the values as the loops run till end right???????
after executing the first function getTransactionFiles( ) i got his output Warning: Undefined variable $files in C:\xampp\htdocs\SB_ET\mini_php_proj_gio\public\index.php on line 16 NULL, can anyone help
Why are you writing your first letter uppercase in "App.php"? Is there a difference in using for example $variableOne and $variable_one. Which one is more preferred?
It's simply a convention/standards, its up to you which one you want to follow. There is a lesson about PSR standards & conventions in second section of the course which can help answer these. I also prefer the short echo statement , less code to write & semicolon is not necessary if its the only statement there so its just my personal preference
I think in that case it should just return empty array because scandir will probably return false, but good point, its always better to be safe & check if directory exists or not.
Thanks a lot for the whole course. At all I understand most of the things, but in this lesson the things happened too fast for me and I'm confused. Probably the problem is in me and I'm too dumb for that :D Anyway thanks again, it's a lot of work to prepare this course!
You are not dumb. Lessons get harder as you continue. It takes me sometimes 2-3 rounds to understand something new myself so its totally normal. When I get stuck I usually take a break or do something else, then come back & do research with fresh mind
Can you explain the parameter: ?callable $transactionHandler = null ? I understand that ?callable means it's "nullable", but isn't the default parameter already set to null? I'm confused. Can you point to where you covered this in the previous videos? Thanks.
When setting default value to null yes that makes parameter nullable, I just prefer to mark type as nullable anyways. Either way is perfectly fine. I personally like to keep it to stay consistent. You can read more about it in the RFC: wiki.php.net/rfc/nullable_types
If I could make a teaching suggestion. You have a tendency to "jump around" while working, which does not provide a smooth learning experience. I feel like the overall experience of the course would drastically improve if you just slowed down a little between transitions. I don't want to sound too critical, it's a free RUclips course after all. The content here is thorough and it is an excellent resource for someone coming to learn PHP as an extra language - but if someone is not experienced in programming, I worry that they would be confused trying to follow the logic. Take a breath between sections.
Thank you for the feedback. I completely agree with you and is a good feedback. The speed improves later in course as I improved on it. Main issue with the earlier videos was that I edited too much out, I removed all empty spaces, so it seems like I don't breathe. This was mistake I tried to fix later on in the course and also slow down a bit. Thanks again for the feedback 🙌
Does anybody know of any resources where people discuss how to learn to approach problems in PHP? This is a wonderful project/lesson but I struggled to know where to begin and apply what i'd learnt previously : (
Any specific issues you are having with this exercise? Ping me on Twitter & I can help answer some questions. I would suggest checking out Laracasts PHP course which is free & is more beginner oriented, so it might help you. You can come back to this afterwards.
First, thank you very much Gio for the Excellent , Excellent tutorials, I cant talk enough about your ability to teach. would love to see you do tutorials on other programming languages like javascript. Second, I notice in the function getTransactions() you open the file but didn't close it by fclose() in here it does seem to not matter, but in building a production website will this cause error down the road?.
another thing, i notice that in extractTransaction(), when you assign the variable $transactionRow, it did not work, as in : $transactionRow = [$date , $checkNumber ..] only the way you write it : [$date , $checkNumber .. ] = $transactionRow; work why is that?
one last things, sorry ;) the getTransactions() after you add the callable parameter, why do you need the if statement, and why it is null be default? can it be used without the need of extractTransaction() like functions? what other uses for the function getTransaction() without passing callable function? i tried deleting the if statement and the removed the null and it worked. but is this mean there are other functionality that are lost? sorry again, for the multiple questions, but your video is very good for learning and make you think.
Hey, sorry for late reply. 1. Its good practice to call fclose(), I probably forgot here. It will automatically close when php script ends but ideally you would close it yourself once you are done using it. 2. Its called array destructuring, thats the correct syntax for it. $transactionRow = [$date , $checkNumber ..]
Sir why do we use arrays as parameters in getTransactionFiles and getTransaction ? I tried working with the string and it works as well .When I try working the arrays as arguments , things don't really wrap around my head like why do we need to use it in the first place .Thank you for your lessons sir.
Not sure what you mean, the method parameters are strings not arrays, function getTransactionFiles(string $dirPath): array here the dirPath is string, not an array. Array is the return type
Hello again Gio Do you think if we watch all your 100 videos from begginer to advanced part and really understand it after couple of months or year , can we apply for some beginner job positions as juniors? Thanks
Hello. Yes I think so, why not? By the end of this series you should have enough knowledge to be able to build stuff & be able to understand frameworks better & start using them. Just make sure to do the final project that we'll start working on soon.
Sir, I want to ask you something. We can normally include file by writing " include '../app/App.php' ". Is there any reason why you used build-in methods?
@@ProgramWithGio No, sir. You used functions such as scandir, dirname to scan the directory and then filtered to get files only like transaction file. Can we just directly access the transaction file without using the above methods? I think we can write the file path, store it in a variable and output all the lines. I might be wrong but I want to see the difference. Thanks for giving me your time, Sir!
I mean we usually navigate the file path in cmd or link the css file in one line using './css/style.css' or 'cd ../../app/' something like that. Can we just use that way to get the file path without using build-in methods. If yes, what will be the pros and cons.
That's assuming name.php is in the same directory as your current file. Otherwise u will have to go up directories & specify directories in path. Having paths defined avoids that part
great teacher but why did you use two arrays to read from the csv file in index file whereas we can just use one array to read lines from csv file by the function ''getTransactions'' without need to ''array_merge'' ?
@@ProgramWithGio teacher .. I have more than one csv files , and the program works fine , whereas I did not use array merge I just wrote like this $transactions=[ ]; foreach($files as $file) { $transactions[ ] = getTransactions($file); }
@@sym2574 then your outer loop that loops over transactions is different, you are creating array of arrays there where with array merge it's just one array. So you probably have double loop somewhere. If you share your code in GitHub I'll take a look
I can not read the $transactions variable within transactions.php although I did require the file path of transactions.php. Please help mee, thanks so much!
Make sure you are including the file properly. If you show me your code I can help you find the issue. You can DM me on twitter and send me a screenshot if you want. Check 6:50 thats where transactions.php is included
I'm just starting php and this tutorial is great but Gio can you please slow down a bit you are kinda too fast 😄😄😄...God bless you...This project looks like rockets science course to me 😀😀😀
Thank you 🙌. I improved on that in the latest videos, for the older ones you can slow it down via RUclips, you can adjust the playback speed. Sorry about that.
Hi, i've been getting array to string conversion error in my views while trying to display array items without destructuring my array (i.e using transaction[0]). i've checked my code and everything is fine. i don't know if it has something to do with my php version, i'm using php 8.0
@@ProgramWithGio thanks i've seen the issue, i used $transaction [] to insert items instead of array_merge(). please can i know the difference between the two? why should i use array_merge instead of inserting directly using $transaction [] = getTrransactions($file);
@@josephjohn4810 [] appends a new element, array_merge merges arrays. If you try to add array as element using [] then you are not merging but adding that array as another element giving you a nested array. Use array merge when u want to merge arrays
You're welcome and don't worry if this was a bit confusing and don't feel disappointed. I've been there & I've felt the same way before. We all start somewhere, I remember the days when I was starting out & how frustrating it was. My advice is to not worry about it & just take your time and improve one step at a time. Also, note that the way I implemented this is not the only way and is not the "best" way either, there are better ways of doing this especially once we move on to the OOP section of the course. Remember that there are many different solutions to a problem. If you have any questions or if something did not make sense let me know & I can help you
@@ProgramWithGio Thank you very much for the support and the kind words, God bless you, we need more good people like you in this world!! I am following your tutorials and I am very grateful, I will take your advice into consideration, looking forward to the OOP way.
@@themetracktor9574 You're welcome & thank you. If you have any questions down the road you can message me on Twitter or comment on videos, I'll be happy to help with what I can. Good luck 🙌
How many students were able to solve this on their own. I have been following the tutorial, but was unable to get even upto 25% of the solution. And when i went through this video, most of it looks somewhat new to me. After referring the php documentation I was able to understand. Am i dumb or wasn't i following the tutorials properly??
No you are not dumb. There are many different ways you could implement this so don't feel discouraged. It's perfectly normal to refer to PHP documentation or Google things, I've been coding for over a decade and I always check docs and google things, you are not expected to remember or know everything. So don't worry about it. If you have specific questions about the solution send me an email or DM on twitter and I can help walk you through it 👍. Also I would rewatch the working with files lesson, that should help with reading files.
Same thing I'm wondering to myself after watching this solution. I'm even reading comments to see if someone else was kinda lost like i was while attempting the exercise and watching the solution. I think my main issue lies with understanding how arrays and functions work together. I need to learn to think like a programmer more. God help me!!!
I could not really do the project on my own. So I had to follow you as you did it. And I learned a lot and feel more confident. Thank you
Glad to hear that, it's ok that you couldn't get it on your own on the first try.
best teacher in youtube, and the most deep explain of full php with clean and clear code, and for 2023, thank you Program with Gio!
Thank you 💙
This series is simply a gold mine! Priceless! And this episode that sums it all up is fucking amazing!!!!
Thank you so much 💙, glad you like it 🙏
WoW!!! Took me couple of hours to make sure I understand and that all makes sense. Thank you, Gio!
You're welcome, thank you
First I did this project myself without using file system, just randomly generating all data I needed. Then remaked it following all your steps in this video and googled each moments, functions which I could not understand. Thank you so much, I learned a lot !
Excellent, that is the best way to learn, awesome job
This whole series is indeed an awesome one. I have well over 5 years experience with PHP, but it feels so good to refresh the memory with the basics and learn some newly introduced features. My target is the advanced section… Especially Unit Test
Thanks so much Gio 🙏. You’re blessed.
Great to hear that, thank you so much
Sir you really go into depth when explaining the php syntax and concepts but I think you should also do the same in your projects,try to explain what your code is doing so its easy to follow through because it really gets tricky especially for beginners like us
I try to explain everything in depth, is there something that lacked explanation? Can you point me to a timestamp?
I think what the gentleman is experiencing is the gaps in his own knowledge. The only solution for that @mmelimahlobo7656 is to note down what you don't understand and either go back to one of the videos where that concept is explained, or look it up online and try to put it to practice yourself. Bonus tip: don't worry about messing up, just try and try until it clicks.@@ProgramWithGio
I started learning Php almost at the end of February 2022. I even built a small personal site with it but now I see I've been learning it the wrong way. I could barely tell my left from my right attempting this exercise. Had to jump and watch the solution *coveringmyface*. I really need to go over the functions and array tutorials again mehn!. Your solution... I was intimidated (i mean this is a good way). I will press on. I need to sit-up. Thanks a whole lot Gio.
Don't worry, you got this. Also there are many ways to solve the problem so my solution isn't the only one. It can be done other ways as well that are also right. So I wouldn't worry about it. Just keep practicing. Good luck 🙌
@@ProgramWithGio Thanks alot Gio. This is a benchmark moment for me. Discouraged but I need to press on. Thanks a lot for the encouragements, I really need it. I don't think I should move on till I've really understood callback functions, anonymous functions and how arrays work. More grease to your elbow Gio
best and best teacher for PHP specially examples about variables differentiate and data types differentiate, thanks from 2024 from pakistan
Appreciate it, thank you 💙
Your solution was more succinct and elegant than mine 😉 I can see where I need to trim stuff. I used for loops instead of foreach, but I can see how foreach is a much better option in this case. I ended up summing up my totals during each iteration while building the transaction array. I was calling another function to aggregate the totals within the function that was building the transaction array. I was thinking this might be saving time (processing?) if I only looped through it once.
In the end, I see the value of having a function be more atomic in terms of what it is expected to do. It was kinda turning into the "everything" function. 😆 I will refactor the code more for the next project.
The reason I am trying to learn PHP is I have to rewrite a Joomla component that has been abandoned. As no one else has created a component with its similar functionality for the latest Joomla release (which uses PHP v8), I've decided that I would be that person. The component uses the MVC pattern, which this latest project in a way is alluding to. Given what I've seen during Section 1, I feel confident that I will be able to do this once I've completed your course.
I've already put to use what I've learned in the real world thought! 😃I had a bunch of mp3 files, in separate folders, that I needed to display on a page using the HTML5 tag. With what you'd taught to date, I was able to do it without any issues. It really felt like an accomplishment. 🙂
Otherwise, I would have had to type out all the file paths and titles by hand. Given there were hundreds of MP3 files, being able to use procedural PHP to do this saved me a lot of time.
As you have likely noticed, I'm basically a n00b when it comes to programming anything. But this course is giving me a lot of confidence, so thank you again! 🙂
That is really awesome. Great job! Most important thing is you got it working, you can always make it better & clean it up. Love that you are applying what you learned to solve problems, that is amazing and kudos to you.
You got the right mindset and are doing everything right so I am confident you will build great things. Good luck 🤞
I have watched this over and over and I don't seem to understand it, but I will give it some time, I Know I will grab a hold of it soon. Thank you Gio, you are a wonderful teacher and person
Don't worry about it. Take it slow and take a break. Thank you and good luck. If you have specific questions feel free to ask me either here or message me on Twitter
...and still the best PHP tutorial for experienced programmers. The parts that I enjoyed most: i) the callable function as a parameter hence making the code more reusable/universal, ii) Enforcing of strict type and type hinting, iii) array destructuring
The tutorial playlist is great, may be a bit challenging for new programmers e.g the intuitive feeling that a certain function should be a helper function other than a business logic function.
All in all, this is great, many thanks.
Thank you 💙💙. Intuitive feeling about certain functions is not expected, this is just my version of the solution but I think as long as beginner implements a working solution for this exercise regardless of what it looks like, I would say it's a success.
@@ProgramWithGio Indeed, thanks 👍🏿
Gio, thank you so much for this video! Great series until now. Looking forward to your next series.
Thank you. Will start publishing new videos soon. They will be part of this series too 👍
As someone who is classified as a beginner in Programming, for me this is already too advanced. Until now, I have watched 31 videos and while I understood most of the concepts, I never really got to use anything until now. With this being the first project, I couldn't even know where to start. Within the first 2 min of the video I knew right away this is way over my head and I never stood a chance. I do enjoy how Gio teaches in these videos but unfortunately I am going to be searching for a more beginner friendly course with more exercises along the way. Maybe one day when I am intermediate or advanced I can revisit this series. Good luck to everyone on the PHP learning journey!
Hey, that's normal. Everyone learns at different pace & different ways. I completely understand. Good luck on your journey, feel free to reach out with any questions 🙌.
Thank you for the feedback 💙
I would recommend CodeAcademy, you got some solid basic there.. and to be honest All tutorial online are repeating over and over the same.
Come back here After.. cause GIo is for me the only tutorial I ran into that deliver an incredible amount of great infos. you wont find anywhere else.
but you will struggle a bit at first but need time to digest go over and write some notes.. :)
the project I failed to make it fully but i got some stuff running. I went into his detailed correction and search for explanation on it :) and i nail the logical.
my code is Messy and i need to google for funtionalities but i guess coder are all like that lol..
repetition and patient will make us the Masters :) ... Thanks again Gio :)
Working with PHP for quite some time ................. haven't seen such a great course ............... kudos and thank you so much !!
Thank you, happy to hear
tada finally done few days ago i completed all the prev 30 videos and jumped on the project at that time i felt it was over for me i couldn't understand even a single line but then i started again from the tutorial 1 and this time investing a lot of time on every single video , a lot of time and now this project not i completed myself but after watching the solution to it i learned a lot of new stuff and everything seems so perfect ...thankk youuuu so much
Awesome, good to hear. Good job
I wrote that program result in same output but your code is well organized, meaningful function name, extendable really nice. i think that is the difference between junior and senior developer , i get many knowledge how to write good program only in single video. really high quality lesson sir. sorry for my english expression.
And that is perfectly normal, also everyone has different style. You'll get better at it with practice. Thank you & glad you did the exercise, good job 💙
I did it my own way before watching this video! My code is ofcourse has terrible quality, ofcourse I googled a lot, but it my first steps in programing. I didn't know anything about php and html before. Only one flow - i can't make horizontal dividing lines, other stuff (such as color change, calculation, output with "$" and "-$", date format and so on) is working. Thank you so much master Gio! Now time to watch how experienced programmer do the task and learn from it, moving forward the course. God bless you and all you love!
That's awesome, great job & don't worry about the quality for now, the important thing is to keep trying & keep practicing. Good luck & thank you
@@ProgramWithGio i didn't get how the comma returns after formatDollarAmount function, i understand how '-' and '$' returns, but not the comma =))
@@ZeppGoesPro That's part of number_format function, www.php.net/number_format
@@ProgramWithGio got it! Thx!
Wow Teacher. This lesson is so excellent. I learned a lot from you, and I continue to learn. Thanks so for all ❤🙏👑
I'm so glad, thank you 🙌🙌
learnt more than just code, but good habit of organising and structuring program. Thank you very much.
That's awesome, glad to hear. Thank you
Okay so I tracked back and went over some of the videos again especially the arrays, working with arrays and the callback functions and anonymous functions etc. I understand it a lot more now. I'll move on in the course. Thanks a lot Gio
That's the right way to learn, great job. Thank you 💙
If someone can follow this free courses from Gio, Technical interview will never hard for him.
Even if I didn't understand everything ,Thank you so much. I have been struggling with php for over a month to find some resources until I found this channel.
I will try to finish the playlist before 2022.
I wish you a happy new year.
Thank you 💙💙. Feel free to ask questions if something was confusing, I'll be happy to clarify & clear things up. Don't rush, take your time. Thanks again and I wish you a happy new year as well 🎄
Thank you Gio. I've learnt so much in a single video 👍
Glad to hear
Wow! Again with another high quality lesson! I really appreciate you Gio
Thank you, and I appreciate you 🙌💙
Simply No words for you,GENIUS! It was a little bit hard but I have done it.Thank you!
Thank you 💙
The best way to learn PHP🙏 Thanks for such a great content
the project's instructions were too ambiguous for me especially instructions 2 & 3, but after watching this, I understand it now. this was short but such an informative video. the explanation would require me to watch it a couple of times before I get the hang of it and finally do it on my own. but still, glad I finally finished the first part
Congrats on finishing the first section, great job
loved the whole playlist, thank you very much, subscribed
Welcome aboard, thank you 💙
Gio , thank you so much for this series
You're welcome
Well some how i manage to complete first part of the course and i can say that the course is very beginner friendly. Thank you Gio you are great.
Great to hear, you're welcome & hope you enjoy the rest of the series too
I love the way you teach and really appreciate your efforts. I have followed all lessons and learned too much as a beginner. Everything is great and well-structured, but for this project which is the practical one, it would have been better if you had started everything from scratch without prepared files and folders.
Because for beginners like me, it is so difficult to follow along and understand everything with the premade folders and files, especially the connection between these files. Thank you very much.
Appreciate the feedback. Did you watch the series from the beginning? We covered pretty much all of the setup in previous episodes
@@ProgramWithGio Thank you very much. Actually, today I read the file called README and most of my concerns (problems) are solved now. Thank you for the nice and complete guidance there in the mentioned file.
@@ProgramWithGio Thank you very much. Yes, I have recently started learning PHP and I am strictly following all these episodes. ABOUT MY PROBLEM: In fact, after studying the README file, my problems were resolved, because everything was explained very well and perfect.
I hope you’re doing well! I really enjoy your content, especially the PHP & Laravel series.
I believe a series on WordPress core development, focusing on plugins and theme development, would be incredibly valuable. Your expertise would provide great insights for many of us looking to enhance our skills.
Thank you. I dont work with WordPress so probably would not be a good quality series
I'm so happy that I could finish the project alone, without wiewing the answer! My code works, but is kinda "bloated". I've got a lot to improve, anyway, thanks for the course, it is much better than a lot of paid ones. :)
That's awesome, it does not matter if its bloated or not, as long as it works. You can improve it & get better little by little
It's so nice to find that my initial soluition for the exercise was somewhat close to what you've done in this video, except it was not so flexible and i formatted dates and amounts right in the view file which looked messy. You're a great teacher Gio. Btw i think for multiple files we need some way of sorting the final transactions array by date.
Glad to hear that. Thank you 🙌. Sorting can be extra credit 🙂, you can try adding it, if you come across questions or need help send me a message
@@ProgramWithGio i used usort built in function passing my sort function in it, i guess it's ok
@@aleksandrkanygin2672 yup that works
Was good for first ever coding experience, done myself 2/3 of this app. My code, of course, VERY ugly and cant process some steps from your guide(i stuck on 'reading all files from directory' feature), and formatting done by me was too dummy, but i really glad to have this experience, doing by myself as many as possible on this step of learning, tries to less use google and etc., seems a good way. After watching this video, solution from sensei, gonna rewrite my code and get close to right realization. Thanks a lot, Gio!
Happy to hear this, glad you did the exercise
Wow Amazing Gio, thank you so much for this video! 🥰
You're welcome
Gio, that was a really high quality exercise, I am impressed! Helped me to put into practice some of the concepts from previous videos that I had been less familiar with. Huge thumbs up. I haven't touched getting files in over a decade probably, and had always struggled with callback/anonymous functions. So I practiced with array_filter to get all positive values to sum, and all negative values to sum (for the totals). I also used array_map and array_column to strip all the currency symbols in one go, but did revise it after watching your solution as parsing the data at the point of reading does make more sense.
Maybe an improvement to doing separate functions for different banks would be to parse the headings row ;) Some banks may return way more columns than needed, for example, or switch up how they send their statements.
Learnt a lot from working on the exercise, plus from comparing it to your solution. Thanks!
Oh, and I added a 'credit_debit' key to my data array and use that to set a class on the amount cell :)
That's amazing. That's the best way to learn & improve. I'm super happy that you gave exercise a try & enjoyed it. Thank you so much 💙💙
Your playlist is really really good
simple, compact , useful
thank you 🌟✨
Thank you 💙
@@ProgramWithGio could you make a short game tutorial please
Thanks, a lot Gio, I am coming from learning javascript and was a little afraid of learning PHP, but your way of explanation is fantastic.🌹🌷
Happy to hear, welcome to PHP world 🙌
This is the greatest php project for beginners 🤩
Thank you 🙌
Thank you for a great tutorial.
You're welcome 🙌
Very informative, shared now
Thank you for sharing! 🙌
Practice makes perfect! Thanks again for this PHP series~
That's right
This course is very helpful to me. Thanks
Glad to hear that
I struggle in figuring out the best way to learn. I've been programming for a little while now in college and it still seems like I know nothing. I had to watch some of your solutions to this when I couldn't figure it out. Is this the best way to learn? Following a tutorial and coding along with the instructor? I drive myself crazy trying to figure out how to become proficient. Good thing is I understand it once I see it, but that's the problem, I feel like I need to see it first. Great class so far though.
Yes that is the best way to learn, watch tutorials & code along. Its perfectly normal in the beginning to not know what to do and understand it after you've seen it. It comes with practice, the more you practice the more you'll know what to do in future. You got this 💪
Thank you so much for this tutorial Gio! You've done absolutely awesome job! Even if, I'm not totally convinced by php (maybe just not yet? 😉), I really appreciate your effort.
It's not easy for me to get the feel of php but I have tried to play with it a bit and this is what I came out with in terms of colouring the transaction amount without if's:
That looks good, thank you 💙
Great video, loved your solution Gio!
Thank you 🙌
In 3:50 , when you changed the getTransactionFiles function in a way that it gets inputs, there is a difference. Before the output was just the name bur now the output us the full address . I don't get it why
We are passing the path as an argument & are prepending it to the file so that way the file is a full path & not just a filename. Before it was just a filename because we were hardcoding the FILES_PATH constant but now it can be different.
Why typing
fgetcsv($file); ignored the header? Does the function itself discard the headers of csv files?
fgetcsv just gets the row from the file. If you don't assign it to anything then it just is discarded.
Thank you very much for this course! I am really amazed how professionally this course is done! However, I would like to ask about the float numbers in the solution of the exercise. You've mentioned in one of your videos before that while working with the float numbers, you have to be very carefully due to their precision issues. So, in this exercise, wouldn't it better to multiply each amount by 100, do calculations (an addition or extraction) and before displaying the final numbers, divide them by 100?
Thank you 💙. In general I would agree, handling monetary values with float type can be dangerous. Better to use objects to represent Money & strings with bcmath. Since this is first section & beginner friendly I didn't want to overwhelm/confuse anyone by using objects & bcmath since objects is part of 2nd section.
Thank you for this valuable course❤
You're welcome
Nice to find this great course and thoroughly enjoying it so far and want to thank you for your efforts. Job well done sir.
but I didn't understand some part in this video (Building Small Part Of The App With Procedural PHP - Full PHP 8 Tutorial)
i will be glad if i can get some explanation on it
Thank you. Sure thing you can message me on Twitter or hop on discord
@@ProgramWithGio I already message you on twiiter
Thanks a lot Gio . Please can we get a series on pure php projects like this one.
Thanks.
We'll work on a project at the end, it will be mainly vanilla but will use composer & bunch of packages to build the app
Thank you so much!!! Your decision so briliant looks perfect Its motivate me to try code cleaner
You're welcome, glad to hear that
Sir would you kindly explain what you just did there when defining your constants,I am a bit puzzled by the concatenation you made on the values of the constants,what does the directory separator achieve?
Can you point me to a specific timestamp? If you are talking about the directory separator constant that just basically adds proper "/" regardless of on which OS it is used on. Technically, you don't even need to use that constant, you can just use "/" and will still work in most if not all cases
Thank you very much!
Wanna see more functional style tutorials 🙂
You're welcome, thank you 💙
Amazing work man!
Thank you 💙
I have some questions:
1. Was there video on your channel about callbacks in first part of course? (I didn't understand this fragment in 12:15 where you used ?callable)
2. Was there video on your channel about "handlers" in php, for what they are etc.? I often hear this term, but I don't know what it means exactly.
2. What this "?" (question mark) which I asked about in first question means? Right before "callable".
3. In about 12:39 - You assigned "$transaction" which is read row of CSV to "$transactionHandler($transaction);", it's line 35 at that moment of video. And right under, there is an assignment to "$transactions[]" array. My question is: Do we have to do it like this? I mean, in my code in pleace of your line 35 I just assigned my $transactions[] array straight to $transactionHandler($transaction). It looks like this: "$transactions[] = $transactionHandler($transaction);". With it I have one line less of code, but I wonder if it can be a mistake? That's why you didn't do it like that in your video.
At the end sorry for my English if there are mistakes. I'm not fluent speaker.
1. Yes we did, check the outline repo (link in description) or the playlist and you should be able to search and find the video
2. This is used interchangeably for different purposes. Handler is something that handles/performs a task or a job. Error handler is something that handles errors, exception handler is something that handles exceptions & so on. Transaction handler in the context of this video simply handles the data extraction from transaction row
3. Transactionhandler can be null, thats why we first check if its null or not, if its not null we call it & then add to array, if its null we just add the transaction record to the array
thank you for this unique course.
You're welcome
using callables is awesome thank you for this. 2 quick questions : 7:12 is a second foreach bad practice to avoid using the keys ? 8:30 array_combine using keys from first row VS array deconstruction ?
Nope not a bad practice, it's just you don't always know the size of inner array, it may also be associative arrays with string keys.
About array combine, not sure I understand, what would you be combining can you show me an example? There are many ways to do things as long as it works 🙂
@@ProgramWithGio when parsing the csv : I used array_combine using the first row of the csv for each line, and sent that array to extractTransaction and used 'Amount' as key for the str_replace. (when parsing csv I like to use associative array using the column name when possible) It works but seeing all I already learned in the basic part of this tutorial ( first time I see array deconstruction ) I wanted to make sure what is best practice. thank you again,
@@DAG_r8 either way works. There is no right or wrong in this case. One thing I would note is that you are relying on the column names which can change and can cause errors later. That's why I explicitly define the keys
wow learnt many things I have completed this task but not this way this way is more felxible
There can be many solutions to a problem. Good job on completing it
@@ProgramWithGio waiting for playlist on Laravel since one year😀
I took a long break from content due to few reasons including personal & work. Will get back on track soon
@@ProgramWithGio looking forward for it
Hello Gio, great tutorial so far, can you further explain how does the code on 6:30 removes the first line/row of csv?
Thank you. It simply reads the first line and moves pointer to next line.
31 videos so far, and it's enjoyable how you teach, can you make a tutorial on how to make a cms with php using class please, it would be Wonderful?
Thank you. We build a project at the end of this series, second section is all about OOP, third is advanced stuff and final section is the project.
Hi Gio,
Thank you for the excellent tutorial. I am currently learning PHP and have covered all the basic topics such as Array methods, functions, loops, and variables. However, I am still finding it difficult to understand the implementation of projects. Can you provide any suggestions or tips that can help me better understand the project?
Hey, it's normal, everyone learns different ways so don't worry about it. I would say do more practice, even if you don't understand it. Working on a project will help you understand things, if you don't understand something research that specific topic, read documentation, then go back to your project & continue. Best way to learn is by building things.
Thank you so much for your suggestions 🙏
please teacher , Can you answer me about this question >> in the view / transactions file , how did the php code take the data from sample.csv file without writing any line or sentence that point to HTML file to take the data from Excel file ?
In this solution we are not taking the file from HTML, we are reading a local directory and getting the CSV file from there. File uploads are covered in second section
In line 31 in 5:20 , I don't get the while loop condition . Why don't you write fgetcsv($file) !== false
?
We are assigning the result to variable $line first and also checking if it's not false.
This series is like a goldmine. I did complete the Simple Calculations project twice. I can't do the project without watching the video once in a while. Now in this situation will it be ok to watch the second section tutorial?
Yes and that is normal, don't worry about it 👍
can someone explain to me how fgetcsv($file) ignores and discards the first line of code in the .csv file?
fgetcsv returns the row from csv & moves pointer to the next row, we are calling fgetcsv and are not assigning to a variable & not doing anything with it so essentially it just gets discarded & pointer is still moved to the next row.
@@ProgramWithGio thanks for you immediate reply, i really appreciate your effort in giving us this package for free. thanks once more
When I get hired I'm going to send you some cash - invaluable sir!!
I appreciate it, thank you. Getting hired after watching my course would be the best gift for me
These are great videos, thank you! Where are the files needed for this project? Like the CSVs etc?
Repository, link in description
Thank you!@@ProgramWithGio
my head spinning😵💫
Take a break & come back to it. Feel free to ask questions if you are stuck on something or if something doesn't make sense. Happy to help
Could you please explain what exactly is happenning in line 10 to 18 in app.php? I mean the foreach loop , the time 3:25
Scans the directory for files & adds each file to the array which then gets returned. Notice that it skips any sub directories, thats what the if conditional check does.
is there a problem with passing a string arguement when the parameter is defined to be a callable? php keeps given me this error
Do you have a function defined with that name?
@@ProgramWithGio yes i think it is a problem with the imports and files location i am working on it.
Hello Gio,
first time in my life i did file handling. I have one question in the code for calculating Totals
function calcTotal(array $records):array {
$totals = [
'total_income'=>0,
'total_expence'=>0,
'net_total'=>0
];
foreach ($records as $record) {
$totals['net_total'] += $record['amount'];
// This line is adding and subtracting the values as the loops run till end right???????
Hello 👋. That is correct
@@ProgramWithGio Hello 👋 Gio. Thank you. I also tried with array_sum but it is taking more steps. Your method is more short.
after executing the first function getTransactionFiles( ) i got his output Warning: Undefined variable $files in C:\xampp\htdocs\SB_ET\mini_php_proj_gio\public\index.php on line 16
NULL,
can anyone help
Error message is saying that files variable isn't defined at line 16. So check line 16, maybe typo or files simply not defined
Why are you writing your first letter uppercase in "App.php"? Is there a difference in using for example $variableOne and $variable_one. Which one is more preferred?
And you are using syntax to print variables without echo. Is there any downside of using this instead of
It's simply a convention/standards, its up to you which one you want to follow. There is a lesson about PSR standards & conventions in second section of the course which can help answer these. I also prefer the short echo statement , less code to write & semicolon is not necessary if its the only statement there so its just my personal preference
teacher may I ask you ,,Why didn't we check if the directory is exist or not in getTransactionFiles function ?
I think in that case it should just return empty array because scandir will probably return false, but good point, its always better to be safe & check if directory exists or not.
Thanks a lot for the whole course. At all I understand most of the things, but in this lesson the things happened too fast for me and I'm confused. Probably the problem is in me and I'm too dumb for that :D Anyway thanks again, it's a lot of work to prepare this course!
You are not dumb. Lessons get harder as you continue. It takes me sometimes 2-3 rounds to understand something new myself so its totally normal. When I get stuck I usually take a break or do something else, then come back & do research with fresh mind
Can you explain the parameter: ?callable $transactionHandler = null ? I understand that ?callable means it's "nullable", but isn't the default parameter already set to null? I'm confused. Can you point to where you covered this in the previous videos? Thanks.
When setting default value to null yes that makes parameter nullable, I just prefer to mark type as nullable anyways. Either way is perfectly fine. I personally like to keep it to stay consistent. You can read more about it in the RFC: wiki.php.net/rfc/nullable_types
If I could make a teaching suggestion. You have a tendency to "jump around" while working, which does not provide a smooth learning experience. I feel like the overall experience of the course would drastically improve if you just slowed down a little between transitions. I don't want to sound too critical, it's a free RUclips course after all. The content here is thorough and it is an excellent resource for someone coming to learn PHP as an extra language - but if someone is not experienced in programming, I worry that they would be confused trying to follow the logic. Take a breath between sections.
Thank you for the feedback. I completely agree with you and is a good feedback. The speed improves later in course as I improved on it. Main issue with the earlier videos was that I edited too much out, I removed all empty spaces, so it seems like I don't breathe. This was mistake I tried to fix later on in the course and also slow down a bit.
Thanks again for the feedback 🙌
Does anybody know of any resources where people discuss how to learn to approach problems in PHP? This is a wonderful project/lesson but I struggled to know where to begin and apply what i'd learnt previously : (
Any specific issues you are having with this exercise? Ping me on Twitter & I can help answer some questions. I would suggest checking out Laracasts PHP course which is free & is more beginner oriented, so it might help you. You can come back to this afterwards.
First, thank you very much Gio for the Excellent , Excellent tutorials, I cant talk enough about your ability to teach. would love to see you do tutorials on other programming languages like javascript.
Second, I notice in the function getTransactions() you open the file but didn't close it by fclose()
in here it does seem to not matter, but in building a production website will this cause error down the road?.
another thing, i notice that in extractTransaction(), when you assign the variable $transactionRow,
it did not work, as in : $transactionRow = [$date , $checkNumber ..]
only the way you write it : [$date , $checkNumber .. ] = $transactionRow; work
why is that?
one last things, sorry ;)
the getTransactions() after you add the callable parameter, why do you need the if statement, and why it is null be default?
can it be used without the need of extractTransaction() like functions? what other uses for the function getTransaction() without passing callable function?
i tried deleting the if statement and the removed the null and it worked. but is this mean there are other functionality that are lost?
sorry again, for the multiple questions, but your video is very good for learning and make you think.
really, this time is the last one.
do you have ideas for procedural projects like this one. in order to drill the information.
Hey, sorry for late reply.
1. Its good practice to call fclose(), I probably forgot here. It will automatically close when php script ends but ideally you would close it yourself once you are done using it.
2. Its called array destructuring, thats the correct syntax for it. $transactionRow = [$date , $checkNumber ..]
Sir why do we use arrays as parameters in getTransactionFiles and getTransaction ? I tried working with the string and it works as well .When I try working the arrays as arguments , things don't really wrap around my head like why do we need to use it in the first place .Thank you for your lessons sir.
Not sure what you mean, the method parameters are strings not arrays, function getTransactionFiles(string $dirPath): array here the dirPath is string, not an array. Array is the return type
Hello again Gio
Do you think if we watch all your 100 videos from begginer to advanced part and really understand it after couple of months or year , can we apply for some beginner job positions as juniors?
Thanks
Hello. Yes I think so, why not? By the end of this series you should have enough knowledge to be able to build stuff & be able to understand frameworks better & start using them. Just make sure to do the final project that we'll start working on soon.
Sir, I want to ask you something. We can normally include file by writing " include '../app/App.php' ". Is there any reason why you used build-in methods?
Do you mean include()? There is no reason, just an old habit that sometimes kicks in. I do tend to use include '...' though more often
@@ProgramWithGio No, sir. You used functions such as scandir, dirname to scan the directory and then filtered to get files only like transaction file. Can we just directly access the transaction file without using the above methods? I think we can write the file path, store it in a variable and output all the lines. I might be wrong but I want to see the difference. Thanks for giving me your time, Sir!
I mean we usually navigate the file path in cmd or link the css file in one line using './css/style.css' or 'cd ../../app/' something like that. Can we just use that way to get the file path without using build-in methods. If yes, what will be the pros and cons.
@@shinpaingmin603 include will evaluate the file, we just need the content of it, also this way we can load multiple files
Hi Why we define paths we can just use require "./name.php" Someone explain please ?
That's assuming name.php is in the same directory as your current file. Otherwise u will have to go up directories & specify directories in path. Having paths defined avoids that part
@@ProgramWithGio Thank you so much
great teacher but why did you use two arrays to read from the csv file in index file whereas we can just use one array to read lines from csv file by the function ''getTransactions'' without need to ''array_merge'' ?
Because there might be more than one csv files and array merge merges transactions from all files
@@ProgramWithGio teacher .. I have more than one csv files , and the program works fine , whereas I did not use array merge
I just wrote like this
$transactions=[ ];
foreach($files as $file)
{
$transactions[ ] = getTransactions($file);
}
@@sym2574 then your outer loop that loops over transactions is different, you are creating array of arrays there where with array merge it's just one array. So you probably have double loop somewhere. If you share your code in GitHub I'll take a look
@@ProgramWithGio okay teacher ,, thank you a lot
I can not read the $transactions variable within transactions.php although I did require the file path of transactions.php. Please help mee, thanks so much!
Make sure you are including the file properly. If you show me your code I can help you find the issue. You can DM me on twitter and send me a screenshot if you want.
Check 6:50 thats where transactions.php is included
I'm just starting php and this tutorial is great but Gio can you please slow down a bit you are kinda too fast 😄😄😄...God bless you...This project looks like rockets science course to me 😀😀😀
Thank you 🙌. I improved on that in the latest videos, for the older ones you can slow it down via RUclips, you can adjust the playback speed. Sorry about that.
Hi, i've been getting array to string conversion error in my views while trying to display array items without destructuring my array (i.e using transaction[0]). i've checked my code and everything is fine. i don't know if it has something to do with my php version, i'm using php 8.0
There is a nested array, check in the video, I have inner loop if the item is array.
@@ProgramWithGio thanks i've seen the issue, i used $transaction [] to insert items instead of array_merge(). please can i know the difference between the two? why should i use array_merge instead of inserting directly using $transaction [] = getTrransactions($file);
@@josephjohn4810 [] appends a new element, array_merge merges arrays. If you try to add array as element using [] then you are not merging but adding that array as another element giving you a nested array. Use array merge when u want to merge arrays
@@ProgramWithGio noted, thanks 🙂
Why others video privated
Some videos are just scheduled to be released within few days
Thank you for the explanation, I am such a noob I am dissapointed :(
You're welcome and don't worry if this was a bit confusing and don't feel disappointed. I've been there & I've felt the same way before. We all start somewhere, I remember the days when I was starting out & how frustrating it was. My advice is to not worry about it & just take your time and improve one step at a time.
Also, note that the way I implemented this is not the only way and is not the "best" way either, there are better ways of doing this especially once we move on to the OOP section of the course. Remember that there are many different solutions to a problem.
If you have any questions or if something did not make sense let me know & I can help you
@@ProgramWithGio Thank you very much for the support and the kind words, God bless you, we need more good people like you in this world!! I am following your tutorials and I am very grateful, I will take your advice into consideration, looking forward to the OOP way.
@@themetracktor9574 You're welcome & thank you. If you have any questions down the road you can message me on Twitter or comment on videos, I'll be happy to help with what I can. Good luck 🙌
Thank you so much, Sir!
You're welcome 🙌
wow. I like it so much. thank you.
Glad to hear 🙌
Great video! Thanks a lot!!
Thank you 🙌
why we use "?callable" before a callback function, as a parameter of another function??
? Means nullable so you can pass a callback or null, it's set to null by default
@@ProgramWithGio thank you
How many students were able to solve this on their own. I have been following the tutorial, but was unable to get even upto 25% of the solution. And when i went through this video, most of it looks somewhat new to me. After referring the php documentation I was able to understand. Am i dumb or wasn't i following the tutorials properly??
No you are not dumb. There are many different ways you could implement this so don't feel discouraged. It's perfectly normal to refer to PHP documentation or Google things, I've been coding for over a decade and I always check docs and google things, you are not expected to remember or know everything. So don't worry about it. If you have specific questions about the solution send me an email or DM on twitter and I can help walk you through it 👍. Also I would rewatch the working with files lesson, that should help with reading files.
i also get very hard to understand
Same thing I'm wondering to myself after watching this solution. I'm even reading comments to see if someone else was kinda lost like i was while attempting the exercise and watching the solution. I think my main issue lies with understanding how arrays and functions work together. I need to learn to think like a programmer more. God help me!!!
My problem is I think Gio needs to slow down little he is kind of fast as in too fast for me to understand all the concepts 😕😕😕
God!! I learned a lot!!!
So happy to hear that, good job 🙌
How did you get so good? Is there any book that helped you master php?
Experience & practice mostly