I would think it's pretty confusing to the viewer that you keep switching from using single ' marks from quotation " marks. I don't know PHP very well, but I'm assuming they are some-what interchangeable. The viewer may not though.
I'm unsure on how to structure a code correctly to give a command within my WHILE loop after executing an IF statement, can you take a look at this thread i posted? tinyurl [dot] com/y8e8jod thank you
I don't understand the significance of $x in PHP as when I change my variable letter to anything other than x it won't display so i figure $x is something special in PHP?
I agree. If you are going to teach, you need to teach proper syntax. It's the equivalent to a biology teacher leaving out connective tissue, an english teacher leaving out periods and a math teacher leaving out parentheses that are necessary to solve a problem in the correct order. It would also be useful to explain why a foreach statement is useful in a real world application, because your example doesn't give the foreach statement the merit it deserves.
well that was abit of a mysterious tutorial as the webpage readout for your code was three. so $x was just the last element of the array, i didnt understand why! thanks no worries i will find out with 5 mins of reading!
Coming from c++ and c# the lack of type safety in php seems quite strange, but then again, I guess that there's a fair degree of freedom that goes along with that.
Remember the curly braces for the above tutorial by the way.
I have watched a few tutorials to brush up on my PHP, and think they are clear and well presented. Thanks.
One thing though on this tutorial, you have this:
foreach ($test as $x) echo $x;
maybe it's woth pointing out that when doing normal programming it is essential to have the curly braces, to tell the PHP interperater when the loop starts and ends:
I'd say its only about 98 percent easier, but you were on the right track.
pivotofpower 6 months ago
@pivotofpower 100x easier he said, not 100%.
learn2math
TheAnimefan112 5 months ago
Utube don't let me post open tags
0oxcmdhackerxo0 8 months ago
I forgot -br /-
0oxcmdhackerxo0 8 months ago
This comment has received too many negative votes show
Waste of time !
davidvdwalle 10 months ago
let me foreach myself.................
hammadghulam 11 months ago
wow this is useful for making calendar
HawxTeamDelta 1 year ago
for each elements of $test is treated as $x (one at a time starting from the 1st) and echoed.
keirnus 1 year ago
I love the foreach loop :p
COMMANO38 1 year ago
thank you very much for this useful tutorial
Waled
nwas555 1 year ago
This has been flagged as spam show
CHECK OUT MY CHANEL TO LEARN HOW TO LEARN IT IN ABOUT 17 HOURS
imwithswat 1 year ago
like the enhanced for loop in java ! thanks bucky
hesham3540 1 year ago
Thank you so much...
coolcam262 1 year ago
Usefull for making websites :)
TheRealAuxiliary 1 year ago
This has been flagged as spam show
Genius. - BehindVFX
mangoprojects 1 year ago
Genius. - BehindVFX
mangoprojects 1 year ago
Genius. - BehindVFX
mangoprojects 1 year ago
I would think it's pretty confusing to the viewer that you keep switching from using single ' marks from quotation " marks. I don't know PHP very well, but I'm assuming they are some-what interchangeable. The viewer may not though.
TheErroneousOne 1 year ago
nice
cocodibani 1 year ago
This has been flagged as spam show
I'm unsure on how to structure a code correctly to give a command within my WHILE loop after executing an IF statement, can you take a look at this thread i posted? tinyurl [dot] com/y8e8jod thank you
cocodibani 1 year ago
What is the reason you get arrayarrayarray when you do: echo $test;?
onnoman 2 years ago
I like Array_values as it offers a more complex and detailed view of the array but for a simple view the foreach and for loops you showed work.
CL0udnyn3 2 years ago
I don't understand the significance of $x in PHP as when I change my variable letter to anything other than x it won't display so i figure $x is something special in PHP?
CL0udnyn3 2 years ago
I was thinking the same thing.
larobertson04 2 years ago
I agree. If you are going to teach, you need to teach proper syntax. It's the equivalent to a biology teacher leaving out connective tissue, an english teacher leaving out periods and a math teacher leaving out parentheses that are necessary to solve a problem in the correct order. It would also be useful to explain why a foreach statement is useful in a real world application, because your example doesn't give the foreach statement the merit it deserves.
iamtheeskimofriend 2 years ago
well that was abit of a mysterious tutorial as the webpage readout for your code was three. so $x was just the last element of the array, i didnt understand why! thanks no worries i will find out with 5 mins of reading!
zimant78 2 years ago
Can somebody tell me for what usefull think I can use that "foreach" because I don't find sence in it
r3sp3c791 2 years ago
Imagine you have a database where there are a LOT more values (hundreds or thousands) it's far less complicated to type than the for statement.
iamtheeskimofriend 2 years ago
Yeah, very nice work there.
All ready learned alot. And will continue watching your video's. And hopefully you will keep up the good work? :)
mKornelius 2 years ago
Thank s for this, I'm going to watch all of your tutorials now, learning a lot!
mkduncan38024 2 years ago
Well tats a new thing here =D thanks a lot buddy
xxheroguyxx 2 years ago
Coming from c++ and c# the lack of type safety in php seems quite strange, but then again, I guess that there's a fair degree of freedom that goes along with that.
Remember the curly braces for the above tutorial by the way.
SwitchRich 2 years ago
thanks
toadums 2 years ago
how do i spit out the first two values only ?? please please help.
StickyAnus 2 years ago
you need to use while make the number of array as a
"$index" or some thing and telling the while to echothe arrays until the "$index" or what ever you chose to call it well be bigger then 2.
hope i helped you to understend what to do =]...
exnext 2 years ago
wowowie wow!!!
thanks again!
pinakapogingbata 2 years ago
or array_values()
Logixmaster 3 years ago 2
thank you so much!
ptrakk 3 years ago
thanks
CoNiLa2 3 years ago
I have watched a few tutorials to brush up on my PHP, and think they are clear and well presented. Thanks.
One thing though on this tutorial, you have this:
foreach ($test as $x) echo $x;
maybe it's woth pointing out that when doing normal programming it is essential to have the curly braces, to tell the PHP interperater when the loop starts and ends:
foreach ($test as $x) { echo $x; {
Hope this helps someone. ;-)
mrRababi 3 years ago 2
the last curly bracket is backwards :P
DerekFord95 3 years ago 5
Great video!
TheEliseoReyes 1 year ago
Brilliant
punkasaurusred 4 years ago 8