I've never seen a tutorial so quick yet thorough and understandable at the same time. You covered everything in such a short amount of time while keeping it clear. Excellent, excellent video. The whole series actually. This would be my go-to suggestion for new or experinced devs
This means alot, thank you 💙. The video speed was an editing mistake I made early on in the series :). I cut out all the empty spaces that make it sound like I don't breathe.
I now understand why my tutors in school hammered us on the fundamentals of programming. My fundamentals are good right now and I don't find it hard to switch to another programming language anymore. Of course, I don't know the ins and outs of that programming language, but I can build things as soon as I know the syntax of the language I am working with. Just like now, I can just go fast through your videos. Just wanted to let you know that your videos are very clear for beginners. Thank you for this series, I think I will learn when I get to your more advanced stuff about classes and such things.
This series is so well done, I'm amazed. Well paced, well explained, and so complete, there are infos that I couldn't find in any other course, probably not for total beginners, but definitely of a quality that is very rare to find.
That's great to hear, thank you so much. First section of the course which is videos numbered 1.* are beginner-friendly so I think it should not be too hard for total beginners to follow. Do you mean by total beginners as someone who has no prior coding experience at all & is starting with PHP? If that's the case then I would agree that it might be a bit harder but should still be able to pick it up, might need to rewatch some videos multiple times though.
@@ProgramWithGio Hi, yes exactly, sorry for being unclear, but I didn't mean it in a negative way, the quality is truly mind blowing, I'm sure that by following along with practice this is a perfect course for everyone. I'm already familiar with php, but with all the informations in this course I feel like finally going to the next level, I can see a lot of details that I have been missing and concepts that were unknown to me. I can't thank you enough and I wish you all the best.
I know you are already bombarded with comments saying how your videos are great, which they really are! Even then, I just wanna say that I love the fact that you don't have topics scattered between videos, instead you have a dedicated tutorials with all information you could ever want about a certain topic. I'm learning by myself PHP, and it makes taking notes so easier. So thank you so much for this great tutorials, and hope you continue growing and publishing top tier videos, as well!
I love your tutorials, clear and concise, and straight to the point, thank you so much for bringing out this series. If it's possible please bring a series just like this on the Laravel framework, I'll be happy to support you.
I'm still here commenting on your videos! You are really making my path to learning PHP much easier than I thought it would be. You did an amazing job, really. Thank you!
Probably the most thorough video course on PHP ever produced. Thank you so much Gio. I do wish you hadn't cut out all of the gaps between sentences during editing though! 😂 I find watching you on .75 speed compensates and gives me just about enough time to take in the concepts and examples. Would second Dushyant's wish for a Laravel Framework series.
Very useful stuff! One thing that can be problematic with arrays is when you want to display a value in a multi-dimension array, but you're not certain all the levels will be present, so you can end up with multiple levels of checks on all the levels of the array. If you just want to display the value if present, the ?? operator can be super handy, as it won't post a warning if any of the levels or missing. For example, you might want to display $user[$next]['jobs']['current']['title'] , and if you're not sure if a user has any jobs, or a current one, or if it has a title, you can end up with something like: echo (isset($user[$next]['jobs'] && $user[$next]['jobs']['current'] && $user[$next]['jobs']['current']['title']) ? $user[$next]['jobs']['current']['title'] : ''); However, with the ?? operator, this can be simplified to: echo ($user[$next]['jobs']['current']['title'] ?? '');
Thank you. If you have such arrays then I would suggest a differently structured data like objects. We cover DTOs in third section so once you get to that point you'll see how DTOs can be helpful in such cases
@@ProgramWithGio That's true, but sometimes you have to work with an existing project, and don't have the control to restructure it. I have also been enjoying the new ?-> operator for working with this sort of structure in objects.
What a great teaching Style!😮 Although already I know the PHP basic staff and OOP after that I see your videos. Because in every single video I learn new things. I see your YT about and see that your first language was PHP and also you works with Laravel. After complete the course If you create a Laravel course really It will be very helpful.💖💖 Thanks again....
Love the videos, great pace and good clear info. I'm interested is learning why many developers use keyed arrays instead of using a StdClass object, for example at 8:57 it would make sense for me for each programming language to be an object. What am I missing as this seems common practice?
Thank you. You could use StdClass objects for sure, if you have a defined structure then objects probably make more sense but also associative arrays are pretty common. Instead of StdClass object you could create an entity class or a DTO that would serve similar purpose. The reason I did not use or talk about objects in this lesson is because objects are covered in 2nd section of the course
Thank you so much for providing these videos Geo. I am doing at leat a lesson a day. My goal is to eventually get good enough to do short term contract work. I am old and use to do a lot of Perl coding back in the day.
Gio Brother your course is well explained and it's very interesting. Brother, please make more courses with real-world projects like Javascript, Python, etc. Thank you Brother for this course . Stay blessed and Happy. 😇
Great and smooth lesson about arrays! And Again I learned and heard new info which I never heard before. I like that you make points where developer should be careful, where can be problems. Lessons well explained that I wondering is it really so natural or you do your homework too? :D Thanks for lesson and waiting for next!
Thank you. So my strategy for recording is that I write down what I know, main points, things to be aware of, etc. Then I do research to confirm that what I know is still valid in the current version because as you know PHP advances & introduces new things, deprecates old stuff, & even the standards change sometimes. And based on the research I make adjustments to my notes and usually I discover some things during this research phase too that I think would be beneficial for developers to know. Some things are small details but in my opinion, these small details play a big role later in programming & that applies to any programming language, not just PHP. In short, yea I do research & homework for sure :)
@@ProgramWithGio Such comment really brings confidence to your content quality! I really cant wait to see what kind content you will bring then or If you will be teaching intermediate PHP stuff!
@@rimantasdanilevicius6754 thank you very much. Yes we will be doing intermediate/advanced topics. Section 1 of course is gonna end soon and we'll begin section 2 which is all about OOP and some cool topics. Section 3 is more advanced stuff. This will be a long course, it won't be a "learn php in 3 hours" type because I want to make sure I cover important topics & in depth.
@@ProgramWithGio Sounds you have plan, and that is really great! Please cover SOLID principles and help to understand how to right code more cleaner. Most examples and exercises on youtube or other channels is just basics and follows no SOLID principles, and such lessons do not train brains to think like programmer should think and does not covers intermediate or advance topics. Hoping in your future projects and lessons you will include exercises and examples which will help train brains work :D
@@rimantasdanilevicius6754 Yup, clean & simple code is part of the course. Once we'll get towards the end of Section 2 & begin Section 3 you'll see more project-like tutorials where we'll write more code. As for SOLID, it's great but sometimes it gets misused or over-used, I'll be sure to cover that as well.
Now I won't need to watch more PHP array videos. I often faced challenges in Laravel when working with multidimensional arrays. I'm hopeful that this tutorial will resolve those issues. Thank you for the valuable knowledge ❤❤
hi why when I compare empty array with empty string or 0 , php return false ? Isn't it true that empty array cast to 0 and if other side be zero , result shod be true in loose compare?
Hi Gio, I was thinking about the [ 'version' => 7.4, 'releaseDate' => 'Nov 28, 2019' ], comma at the end of this array and there is also comma that is at the end of index1(array) in python versions. Are these commas necessary and also at the end of versions enclosing these arrays
Please guide me in this situation . I wanna to store hallID as a key and hall_Capacity as a value and these keys and values we fetch from Database Table. $examination_hall = array( $hallID=>$capacity
); print_r($examination_hall); // ( [1] => 10 [2] => 20 [3] => 30 ) I want output like this but output showing only [3] => 30
@@ProgramWithGio Thank you so much .values with keys are stored in array but I have another issue. I want to use hall_id in insert query .For example if first hall capacity are 10 then first hall_id use ten time only in this query after this it comes to second hall_id and then third hall_id according to capacity. Now all values are stored in array but still in insert query use hall_id 3 only .i write code for this plz check it $examination_hall[$hallID] = $capacity; foreach ($examination_hall as $hall) { $currenthall_cap=" "; / / this variable declare for store the current capacity of hall against of each hall_id $currenthall_cap = $hall; while ($currenthall_cap > 0 && $StudentCount > 0 ){ $schedule = "INSERT INTO exam_sched (student_id, hall_id) VALUES({$studentID[$studentCounter]},{$hallID})"; if(mysqli_query($conn,$schedule));
{ $studentCounter++; $currenthall_cap--; // when current hall capacity become 0 it must be go to second hall but the hall_id remain same. $StudentCount--;
@@sheezanawaz476 sorry but it's hard to understand what the issue is. Ping me on Twitter and send me a screenshot of formatted code with a little more explanation
There are differences. Checking for variable in if statement checks for truthy value while isset checks if the variable is defined or key is set in array
Is there anything like this in php as how it is in python without using loop; num = [4, 7, 9, 0, 2] print num[0:2] This is to print from index 0 to index 2 which the output is 4, 7, 9
You're welcome. Later in the course I provide source code for certain videos. Didn't think source for this video was important since it's mainly overview
That's just how it gets casted when used as array key. You can read more about it in the docs here: www.php.net/manual/en/language.types.array.php `Strings containing valid decimal ints, unless the number is preceded by a + sign, will be cast to the int type. E.g. the key "8" will actually be stored under 8. On the other hand "08" will not be cast, as it isn't a valid decimal integer. Floats are also cast to ints, which means that the fractional part will be truncated. E.g. the key 8.7 will actually be stored under 8. Bools are cast to ints, too, i.e. the key true will actually be stored under 1 and the key false under 0. Null will be cast to the empty string, i.e. the key null will actually be stored under "".`
I understand your question now. The reason string overwrites integer is because it comes after, same with float 1.8 value overwrites previous ones because all of those get cast into 1
I would assume because it can't hold anymore values? I'm not sure to be honest, maybe something has to do with the way arrays are implemented in PHP, they are essentially hash tables. This article might help: www.npopov.com/2012/03/28/Understanding-PHPs-internal-array-implementation.html
@@ProgramWithGio "that you" souded like it. I found it funny but its also late so I might just be tired and lonely. This tutorial helped me greatly tho! Just what I needed to make this work!
@@dogvscatfunny9956 the lesson is about arrays, I think I clearly explain what arrays are. The meaning of values don't matter in this. Have you watched series from beginning or just watching this video?
@@ProgramWithGio At first, of course, it was clear, but now you can’t understand anything, where it comes from, and as a result, nothing is clear anymore.
@@dogvscatfunny9956 I'm not understanding to be honest what exactly isn't clear. Like what comes from where? If you can't explain the exact problem you are having then I'm afraid I can't really help you. Can you give me a specific example like a timestamp in the video and explain what's not clear?
This is not a course about how to program in PHP, but how to do it with love and best right way!
Thanks forever!
Thank you 💙
I've never seen a tutorial so quick yet thorough and understandable at the same time. You covered everything in such a short amount of time while keeping it clear.
Excellent, excellent video. The whole series actually. This would be my go-to suggestion for new or experinced devs
This means alot, thank you 💙. The video speed was an editing mistake I made early on in the series :). I cut out all the empty spaces that make it sound like I don't breathe.
I now understand why my tutors in school hammered us on the fundamentals of programming. My fundamentals are good right now and I don't find it hard to switch to another programming language anymore. Of course, I don't know the ins and outs of that programming language, but I can build things as soon as I know the syntax of the language I am working with. Just like now, I can just go fast through your videos. Just wanted to let you know that your videos are very clear for beginners. Thank you for this series, I think I will learn when I get to your more advanced stuff about classes and such things.
That's awesome, thank you, I appreciate it. Yes it gets more fun later on 🙂
You are doing a great job, I ll definetely recomend this series to others.
Thank you. I appreciate it 🙌
Me too
This series is so well done, I'm amazed. Well paced, well explained, and so complete, there are infos that I couldn't find in any other course, probably not for total beginners, but definitely of a quality that is very rare to find.
That's great to hear, thank you so much. First section of the course which is videos numbered 1.* are beginner-friendly so I think it should not be too hard for total beginners to follow. Do you mean by total beginners as someone who has no prior coding experience at all & is starting with PHP? If that's the case then I would agree that it might be a bit harder but should still be able to pick it up, might need to rewatch some videos multiple times though.
@@ProgramWithGio Hi, yes exactly, sorry for being unclear, but I didn't mean it in a negative way, the quality is truly mind blowing, I'm sure that by following along with practice this is a perfect course for everyone. I'm already familiar with php, but with all the informations in this course I feel like finally going to the next level, I can see a lot of details that I have been missing and concepts that were unknown to me. I can't thank you enough and I wish you all the best.
No worries, I didn't think it was negative in any way, I'm always open for feedback. Thank you so much 🙏. Glad you found my videos helpful
I know you are already bombarded with comments saying how your videos are great, which they really are! Even then, I just wanna say that I love the fact that you don't have topics scattered between videos, instead you have a dedicated tutorials with all information you could ever want about a certain topic.
I'm learning by myself PHP, and it makes taking notes so easier.
So thank you so much for this great tutorials, and hope you continue growing and publishing top tier videos, as well!
Happy to hear that, thank you 🙌. Feel free to ask questions as you are going through the series 👍
Most of the php tuorial on youtube are outdated,thanks for your effort
You're welcome 👍
This course and channel is WAY underrated. Good job with your videos man!
Thank you 💙💙
wow probably the best program tutor, very detailed and understandable.thanks a lot
You are welcome & thank you 💙
A big shoutout to Gio for his generosity in sharing his PHP expertise!
Thank you
I love your tutorials, clear and concise, and straight to the point, thank you so much for bringing out this series. If it's possible please bring a series just like this on the Laravel framework, I'll be happy to support you.
Thank you 🙏
OH MY GOD!! how come i haven't got to know about this Course... this is GODLY course mannnn! 🔥🔥
Welcome & thank you
Best stuff for learning php I got in to so far! I must say I feel lucky I got here somehow.
Really glad you like it. Thank you
I'm still here commenting on your videos!
You are really making my path to learning PHP much easier than I thought it would be.
You did an amazing job, really.
Thank you!
Happy to hear, thank you
Thanks!
Thank you for your support 💙
I had never seen this kind of informative video about arrays.
Love from Bangladesh.
Thank you
Great series, keep going.
Thank you. Will do 👍
This is the second time I have watched this video. And I have a deeper understanding of some knowledge.
That's great to hear
Probably the most thorough video course on PHP ever produced. Thank you so much Gio. I do wish you hadn't cut out all of the gaps between sentences during editing though! 😂 I find watching you on .75 speed compensates and gives me just about enough time to take in the concepts and examples. Would second Dushyant's wish for a Laravel Framework series.
Thank you 💙. I was a bad editor 😁 still am but improving little by little heh
Thank you very much for the time and effort to give this great piece a little or no cost. It is precise, simple. Thanks once again.
You're welcome & thank you
Thanks for this amazing video! They don't teach it like this in school.
Thank you 🙌
total quality series for people having some experience in PHP. Good going GIO
Thank you 💙💙
@@ProgramWithGio are u on Instagram/ Facebook?
@@prajwalsiwakoti9866 I use Twitter mainly
Amazing in-depth lecture. :D Thanks
Thank you
thank you for the lesson
You're welcome
i'm not just learning great things , i'm reallyy ENJOOOYING
Happy to hear that, thanks 💙
@@ProgramWithGio 🥰
Thanks. Very good explanation
WOW !
To the point , understandable , really really great !
Thank you
superb lesson GIO 💙
Thank you
Wow you showed me everything behind arrays in php. thank you so much! nice videos.
Glad it was helpful! You're welcome & thank you 💙
Very useful stuff!
One thing that can be problematic with arrays is when you want to display a value in a multi-dimension array, but you're not certain all the levels will be present, so you can end up with multiple levels of checks on all the levels of the array. If you just want to display the value if present, the ?? operator can be super handy, as it won't post a warning if any of the levels or missing.
For example, you might want to display $user[$next]['jobs']['current']['title'] , and if you're not sure if a user has any jobs, or a current one, or if it has a title, you can end up with something like:
echo (isset($user[$next]['jobs'] && $user[$next]['jobs']['current'] && $user[$next]['jobs']['current']['title']) ? $user[$next]['jobs']['current']['title'] : '');
However, with the ?? operator, this can be simplified to:
echo ($user[$next]['jobs']['current']['title'] ?? '');
Thank you. If you have such arrays then I would suggest a differently structured data like objects. We cover DTOs in third section so once you get to that point you'll see how DTOs can be helpful in such cases
@@ProgramWithGio That's true, but sometimes you have to work with an existing project, and don't have the control to restructure it. I have also been enjoying the new ?-> operator for working with this sort of structure in objects.
This is a really well made course, thank you!
Glad you like it. Thank you
I didn't know php evolve a lot. great vid. thanks.
Thank you
What a great teaching Style!😮 Although already I know the PHP basic staff and OOP after that I see your videos. Because in every single video I learn new things.
I see your YT about and see that your first language was PHP and also you works with Laravel. After complete the course If you create a Laravel course really It will be very helpful.💖💖 Thanks again....
That's great to hear, thank you. There will be more content on Laravel after this 👍
@@ProgramWithGio Waiting for Laravel Course.
Whoop! This was a long one 😄
Never knew I could use something like, [...., 30 => 'value', 'other', 'another'....]
😄. Yea arrays are great.
It's impossible to do without arrays. Thanks for the video!
You're welcome
So much usefull stuff, up to all details 👍👍
Glad you liked it
Love the videos, great pace and good clear info. I'm interested is learning why many developers use keyed arrays instead of using a StdClass object, for example at 8:57 it would make sense for me for each programming language to be an object. What am I missing as this seems common practice?
Thank you. You could use StdClass objects for sure, if you have a defined structure then objects probably make more sense but also associative arrays are pretty common. Instead of StdClass object you could create an entity class or a DTO that would serve similar purpose. The reason I did not use or talk about objects in this lesson is because objects are covered in 2nd section of the course
Thank you so much for providing these videos Geo. I am doing at leat a lesson a day. My goal is to eventually get good enough to do short term contract work. I am old and use to do a lot of Perl coding back in the day.
You're welcome my friend & thank you. Age does not matter to be honest, just be consistent & you'll get there, good luck 🤞
You are teaching well amazing series please create more series specially python and Java Script
Thank you
the best!
Gio Brother your course is well explained and it's very interesting.
Brother, please make more courses with real-world projects like Javascript, Python, etc.
Thank you Brother for this course . Stay blessed and Happy.
😇
Thank you 🙌
awesome teacher
Thanks!!! you are doing a great job here. This is very helpful
Glad to hear that, you're welcome 🙌
@@ProgramWithGio Thanks 🤓. I'll definitely recommend your serie 💪🏼
good explanation.....................
Thank you
Great work Appreciated, thanks a lot.
Thank you 🙏
thank you so much for your efforts
You're welcome 🙌
Thank you, Gio! you are really amazing ! :))
Thank you 🙌
Great job. Love the example at 11:00. Who is Gio?
Thank you 🙌. Gio is short for my name
Great and smooth lesson about arrays! And Again I learned and heard new info which I never heard before. I like that you make points where developer should be careful, where can be problems. Lessons well explained that I wondering is it really so natural or you do your homework too? :D
Thanks for lesson and waiting for next!
Thank you. So my strategy for recording is that I write down what I know, main points, things to be aware of, etc. Then I do research to confirm that what I know is still valid in the current version because as you know PHP advances & introduces new things, deprecates old stuff, & even the standards change sometimes. And based on the research I make adjustments to my notes and usually I discover some things during this research phase too that I think would be beneficial for developers to know. Some things are small details but in my opinion, these small details play a big role later in programming & that applies to any programming language, not just PHP.
In short, yea I do research & homework for sure :)
@@ProgramWithGio Such comment really brings confidence to your content quality!
I really cant wait to see what kind content you will bring then or If you will be teaching intermediate PHP stuff!
@@rimantasdanilevicius6754 thank you very much. Yes we will be doing intermediate/advanced topics. Section 1 of course is gonna end soon and we'll begin section 2 which is all about OOP and some cool topics. Section 3 is more advanced stuff. This will be a long course, it won't be a "learn php in 3 hours" type because I want to make sure I cover important topics & in depth.
@@ProgramWithGio Sounds you have plan, and that is really great!
Please cover SOLID principles and help to understand how to right code more cleaner. Most examples and exercises on youtube or other channels is just basics and follows no SOLID principles, and such lessons do not train brains to think like programmer should think and does not covers intermediate or advance topics. Hoping in your future projects and lessons you will include exercises and examples which will help train brains work :D
@@rimantasdanilevicius6754 Yup, clean & simple code is part of the course. Once we'll get towards the end of Section 2 & begin Section 3 you'll see more project-like tutorials where we'll write more code. As for SOLID, it's great but sometimes it gets misused or over-used, I'll be sure to cover that as well.
The last tip is fkn amazing!
Thanks 🙏
Now I won't need to watch more PHP array videos. I often faced challenges in Laravel when working with multidimensional arrays. I'm hopeful that this tutorial will resolve those issues. Thank you for the valuable knowledge ❤❤
Glad it was helpful 💙💙
One of the best in its kind
Thank you 💙
thank u sir.
You're welcome, 💙
like other videos, best of its kind!
💙💙
thank you
You're welcome 🙌
thank you, we need to end the course real project
Yes, we'll do real projects towards the end of the course. We are still at early stage in the course 👍
@@ProgramWithGio thank you very much for your effort
@@ahmedhabeeb2499 you're welcome 🙌
4:12 made me chuckle lol
😁😁
🏆legendary
Thank you
Many thx
You're welcome
Thank you!
You're welcome
Another way of adding to an array is using "..." operator
$a = ['a', 'b', 'c'];
var_dump([...$a, ]);
Its more like creating a new array while combining the other array elements with new, but yes
hi
why when I compare empty array with empty string or 0 , php return false ?
Isn't it true that empty array cast to 0 and if other side be zero , result shod be true in loose compare?
I found a answer for own question :)
array is always greater then anything , because of that when compare array with anything result is false.
I'm sorry for the super late reply. TH-cam did not notify me about this & just came across it. Glad you figured it out 💙
intresting, i wonder if access to assosiative array(with key, ) in php , works as hash table?
Yes, internally I think it uses hash table mechanism
ty
You're welcome
Hi Gio, I was thinking about the [ 'version' => 7.4, 'releaseDate' => 'Nov 28, 2019' ], comma at the end of this array and there is also comma that is at the end of index1(array) in python versions. Are these commas necessary and also at the end of versions enclosing these arrays
Hey, no they are not necessary its optional, so mostly its up to you & the conventions that you follow.
The Ethiopian God bless you 🎉🎉🎉
Thank you & you too 🎉
@@ProgramWithGio do you think there will be still demand for PHP developers?
In my opinion yes
pls make a video on which extensions you are using pls make some small video
I don't use any extensions, just vanilla phpstorm IDE
@@ProgramWithGio ok ty
Please guide me in this situation . I wanna to store hallID as a key and hall_Capacity as a value and these keys and values we fetch from Database Table. $examination_hall = array(
$hallID=>$capacity
);
print_r($examination_hall);
// ( [1] => 10 [2] => 20 [3] => 30 ) I want output like this but output showing only [3] => 30
Because you are overwriting the array every time. Do it this way $examination_hall[$hallID] = $capacity
@@ProgramWithGio Thank you so much .values with keys are stored in array but I have another issue. I want to use hall_id in insert query .For example if first hall capacity are 10 then first hall_id use ten time only in this query after this it comes to second hall_id and then third hall_id according to capacity. Now all values are stored in array but still in insert query use hall_id 3 only .i write code for this plz check it $examination_hall[$hallID] = $capacity; foreach ($examination_hall as $hall) {
$currenthall_cap=" "; / / this variable declare for store the current capacity of hall against of each hall_id
$currenthall_cap = $hall; while ($currenthall_cap > 0 && $StudentCount > 0 ){ $schedule = "INSERT INTO exam_sched (student_id, hall_id)
VALUES({$studentID[$studentCounter]},{$hallID})"; if(mysqli_query($conn,$schedule));
{
$studentCounter++;
$currenthall_cap--; // when current hall capacity become 0 it must be go to second hall but the hall_id remain same.
$StudentCount--;
} } }
@@sheezanawaz476 sorry but it's hard to understand what the issue is. Ping me on Twitter and send me a screenshot of formatted code with a little more explanation
@@ProgramWithGio but I have no tweeter account.
Why use isset() function when you can get the same result putting a variable as a parameter for an if statement?
There are differences. Checking for variable in if statement checks for truthy value while isset checks if the variable is defined or key is set in array
Is there anything like this in php as how it is in python without using loop;
num = [4, 7, 9, 0, 2]
print num[0:2]
This is to print from index 0 to index 2 which the output is 4, 7, 9
Not yet
@@ProgramWithGio Alright, thank you so much
thanks for the effort . source code would be better
You're welcome. Later in the course I provide source code for certain videos. Didn't think source for this video was important since it's mainly overview
Why null cast to empty string Not 0 . in Index three cast 1.8 to integer and in Index four cast to string why ?! 11.03
That's just how it gets casted when used as array key. You can read more about it in the docs here: www.php.net/manual/en/language.types.array.php
`Strings containing valid decimal ints, unless the number is preceded by a + sign, will be cast to the int type. E.g. the key "8" will actually be stored under 8. On the other hand "08" will not be cast, as it isn't a valid decimal integer.
Floats are also cast to ints, which means that the fractional part will be truncated. E.g. the key 8.7 will actually be stored under 8.
Bools are cast to ints, too, i.e. the key true will actually be stored under 1 and the key false under 0.
Null will be cast to the empty string, i.e. the key null will actually be stored under "".`
Is array a data structure or a data type ??
I would say both
Array keys why string '1' replace intger 1.
Where did you see '1'? I used integers for keys. In one part I used '1' to show an example that '1', 1 and true would be same keys and overwrite.
@@ProgramWithGio in 10:22sec foo baz example you using string and integer key?
@@pravin1074 yea that's to demonstrate that it overwrites. I also use float right after 1.8 and as you see the result is that last one overwrites.
I understand your question now. The reason string overwrites integer is because it comes after, same with float 1.8 value overwrites previous ones because all of those get cast into 1
I think this section on array and keys should have been broken into two videos...it's alot to comprehend with keys and array indexes
Thanks for the suggestion
გიო ლარაველის კურსი როდის დაიდება :D
ზაფხულის ბოლოსკენ ალბათ. დავიწყე მუშაობა კურსზე
მადობა
$arr = [PHP_INT_MAX => 1, 2, 3];
Warning: Cannot add element to the array as the next element is already occupied
I would assume because it can't hold anymore values? I'm not sure to be honest, maybe something has to do with the way arrays are implemented in PHP, they are essentially hash tables. This article might help: www.npopov.com/2012/03/28/Understanding-PHPs-internal-array-implementation.html
daddy? :3 5:16
@@DasHeino2010 ??
@@ProgramWithGio "that you" souded like it. I found it funny but its also late so I might just be tired and lonely. This tutorial helped me greatly tho! Just what I needed to make this work!
@@DasHeino2010 haha, that's funny. Glad it was helpful 🙏
Well, it's not clear at all what he's talking about there. Who understood?
@@dogvscatfunny9956 can you be more specific on what's not clear?
@@ProgramWithGio Examples with arrays, key-value records, it is not clear what this is, the form of the record itself is not clear
@@dogvscatfunny9956 the lesson is about arrays, I think I clearly explain what arrays are. The meaning of values don't matter in this. Have you watched series from beginning or just watching this video?
@@ProgramWithGio At first, of course, it was clear, but now you can’t understand anything, where it comes from, and as a result, nothing is clear anymore.
@@dogvscatfunny9956 I'm not understanding to be honest what exactly isn't clear. Like what comes from where? If you can't explain the exact problem you are having then I'm afraid I can't really help you. Can you give me a specific example like a timestamp in the video and explain what's not clear?
thank you!
You're welcome!
Thank you
You're welcome
thank you
You're welcome