RE: [PHP] while-question

2008-11-19 Thread bruce
-general@lists.php.net Subject: RE: [PHP] while-question Dabbling? I think that making a living from it isn't dabbling, so I may not be qualified to speak for the dabblers. But for me, I was writing code before there were such courses. Later, when I went to college I was taught

Re: [PHP] while-question

2008-11-19 Thread Shawn McKenzie
bruce wrote: interesting points regarding college and programming.. my degrees bsee/msee covered alot more than pure programing.. as a double ee/cs, the ability to articulate an issue/problem, and bring to mind a cogent thought process was valuable. the ability to understand how different

Re: [PHP] while question

2008-11-18 Thread Nathan Rixham
Ashley Sheridan wrote: On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote: Ashley Sheridan wrote: On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote: Only thing to note with the foreach is that you are actually working on a copy of the array, so if you intend to modify it, pass it

Re: [PHP] while-question

2008-11-18 Thread Nathan Rixham
tedd wrote: At 7:02 PM -0500 11/17/08, Craige Leeder wrote: I'm not illiterate; promise :p - Craige Yeah, his parents were married before he was born. Cheers, tedd omg tedd, I was just reading this thread over, thought exactly that witty response, clicked you're reply and there it is;

Re: [PHP] while-question

2008-11-18 Thread Craige Leeder
Jochem Maas wrote: just for laughs .. given the 'dabble' thread Cleeder is phonetically very very close to a dutch word meaning 'messing around' .. rather in the way a 2yo might mess around with a bowl of yogurt. Haha, now that does make me laugh. Out of curiosity, what is the actual word

Re: [PHP] while-question

2008-11-18 Thread Jochem Maas
Craige Leeder schreef: Jochem Maas wrote: just for laughs .. given the 'dabble' thread Cleeder is phonetically very very close to a dutch word meaning 'messing around' .. rather in the way a 2yo might mess around with a bowl of yogurt. Haha, now that does make me laugh. Out of curiosity,

Re: [PHP] while-question

2008-11-18 Thread Craige Leeder
Jochem Maas wrote: klieder ... kliederen the E sound is short. Interesting to know. Thanks :D - Craige -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] while-question

2008-11-18 Thread Nathan Rixham
Craige Leeder wrote: Jochem Maas wrote: klieder ... kliederen the E sound is short. Interesting to know. Thanks :D - Craige don't believe him, jochem is really called Bob Davis, a slightly balding middle aged ASP developer from hull sent to infiltrate the PHP community and misguide

Re: [PHP] while-question

2008-11-18 Thread Bastien Koert
On Tue, Nov 18, 2008 at 9:33 AM, Nathan Rixham [EMAIL PROTECTED] wrote: Craige Leeder wrote: Jochem Maas wrote: klieder ... kliederen the E sound is short. Interesting to know. Thanks :D - Craige don't believe him, jochem is really called Bob Davis, a slightly balding middle aged

Re: [PHP] while-question

2008-11-18 Thread Robert Cummings
On Tue, 2008-11-18 at 14:33 +, Nathan Rixham wrote: Craige Leeder wrote: Jochem Maas wrote: klieder ... kliederen the E sound is short. Interesting to know. Thanks :D - Craige don't believe him, jochem is really called Bob Davis, a slightly balding middle aged ASP

Re: [PHP] while question

2008-11-18 Thread Ashley Sheridan
On Tue, 2008-11-18 at 10:52 +, Nathan Rixham wrote: Ashley Sheridan wrote: On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote: Ashley Sheridan wrote: On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote: Only thing to note with the foreach is that you are actually working

Re: [PHP] while question

2008-11-17 Thread Stut
On 17 Nov 2008, at 13:01, Alain Roger wrote: i'm on PHP training and our lector is telling us that to avoid counting an array item amout thanks count($my_array), he tells we can do: while($my_array) { ... do something } but from experience this is an infinity loop... it should be always

Re: [PHP] while question

2008-11-17 Thread Thodoris
Hi, i'm on PHP training and our lector is telling us that to avoid counting an array item amout thanks count($my_array), he tells we can do: while($my_array) { ... do something } but from experience this is an infinity loop... it should be always something like $count = count($my_array);

RE: [PHP] while question

2008-11-17 Thread Jay Blanchard
[snip] ...foreach... [/snip] You could also use a for loop if you wanted to count; for($i = 0; $i count($array); $i++){ echo $i . \n; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
Timo Erbach schreef: ...but for best performance you should do: $counter = count($array); for($i = 0; $i $counter; $i++){ echo $i . \n; } just for fun: $a = range(1,10); for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++); ... gives an idea of the power and flexibility of a

Re: [PHP] while-question

2008-11-17 Thread Nathan Rixham
Jochem Maas wrote: $a = range(1,10); for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++); think the point of this is to count the items in an array without count mate :p no point in the above you could just: $c = count($a); foreach! $a = range(1,10); $c = 0; foreach($a as $b) {

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
Nathan Rixham schreef: Jochem Maas wrote: $a = range(1,10); for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++); think the point of this is to count the items in an array without count mate :p no point in the above you could just: $c = count($a); I thought the point was to avoid

Re: [PHP] while-question

2008-11-17 Thread Stut
On 17 Nov 2008, at 14:31, Nathan Rixham wrote: if you really want a challenge try this one.. task: add the numbers 5 and 17 together, using php, without using the + operator. fill it in: function add($a , $b) { //code here but no + - / * operators return $answer; } echo add(5, 17);

Re: [PHP] while-question

2008-11-17 Thread Andrew Ballard
On Mon, Nov 17, 2008 at 9:47 AM, Jochem Maas [EMAIL PROTECTED] wrote: Nathan Rixham schreef: Jochem Maas wrote: $a = range(1,10); for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++); think the point of this is to count the items in an array without count mate :p no point in the

Re: [PHP] while-question

2008-11-17 Thread Nathan Rixham
Stut wrote: On 17 Nov 2008, at 14:31, Nathan Rixham wrote: if you really want a challenge try this one.. task: add the numbers 5 and 17 together, using php, without using the + operator. fill it in: function add($a , $b) { //code here but no + - / * operators return $answer; } echo add(5,

Re: [PHP] while-question

2008-11-17 Thread Robert Cummings
On Mon, 2008-11-17 at 14:54 +, Stut wrote: On 17 Nov 2008, at 14:31, Nathan Rixham wrote: if you really want a challenge try this one.. task: add the numbers 5 and 17 together, using php, without using the + operator. fill it in: function add($a , $b) { //code here but no + -

RE: [PHP] while-question

2008-11-17 Thread bruce
... ? -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 9:53 AM To: Stut Cc: Nathan Rixham; php-general@lists.php.net Subject: Re: [PHP] while-question On Mon, 2008-11-17 at 14:54 +, Stut wrote: On 17 Nov 2008, at 14:31, Nathan Rixham wrote

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
Robert Cummings schreef: On Mon, 2008-11-17 at 14:54 +, Stut wrote: On 17 Nov 2008, at 14:31, Nathan Rixham wrote: if you really want a challenge try this one.. task: add the numbers 5 and 17 together, using php, without using the + operator. fill it in: function add($a , $b) {

RE: [PHP] while-question

2008-11-17 Thread Robert Cummings
On Mon, 2008-11-17 at 10:00 -0800, bruce wrote: curious qiestion to all on here who dabble in php... how many of you have actully gone to college, taken algorithm courses, microprocessor courses, design/architecture courses, etc.. or is the majority of the work here from people who've

Re: [PHP] while-question

2008-11-17 Thread Robert Cummings
On Mon, 2008-11-17 at 19:07 +0100, Jochem Maas wrote: Robert Cummings schreef: On Mon, 2008-11-17 at 14:54 +, Stut wrote: On 17 Nov 2008, at 14:31, Nathan Rixham wrote: if you really want a challenge try this one.. task: add the numbers 5 and 17 together, using php, without using

Re: [PHP] while-question

2008-11-17 Thread Nathan Rixham
bruce wrote: curious qiestion to all on here who dabble in php... how many of you have actully gone to college, taken algorithm courses, microprocessor courses, design/architecture courses, etc.. or is the majority of the work here from people who've grabbed the tools and started

RE: [PHP] while-question

2008-11-17 Thread tedd
At 10:00 AM -0800 11/17/08, bruce wrote: curious qiestion to all on here who dabble in php... how many of you have actully gone to college, taken algorithm courses, microprocessor courses, design/architecture courses, etc.. or is the majority of the work here from people who've grabbed the

RE: [PHP] while-question

2008-11-17 Thread Wolf
Dabbling? I think that making a living from it isn't dabbling, so I may not be qualified to speak for the dabblers. But for me, I was writing code before there were such courses. Later, when I went to college I was taught adventures in keypunching and received several next to

RE: [PHP] while-question

2008-11-17 Thread tedd
At 2:55 PM -0500 11/17/08, Wolf wrote: Tedd, glad you got hooked on Phonics. One of these days I hope from graduating from just looking at the pictures, but right now the pictures are oh so enticing!. ;) Wolf Wolf: Lot's of exciting things -- hard to keep up on bots, automated buying,

Re: [PHP] while question

2008-11-17 Thread Craige Leeder
Alain Roger wrote: Hi, i'm on PHP training and our lector is telling us that to avoid counting an array item amout thanks count($my_array), he tells we can do: while($my_array) { ... do something } but from experience this is an infinity loop... it should be always something like $count =

Re: [PHP] while question

2008-11-17 Thread Ashley Sheridan
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote: Alain Roger wrote: Hi, i'm on PHP training and our lector is telling us that to avoid counting an array item amout thanks count($my_array), he tells we can do: while($my_array) { ... do something } but from experience this

Re: [PHP] while question

2008-11-17 Thread Craige Leeder
Ashley Sheridan wrote: On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote: Only thing to note with the foreach is that you are actually working on a copy of the array, so if you intend to modify it, pass it by reference. - Craige Can you do that? I assume it would look like this:

Re: [PHP] while question

2008-11-17 Thread Ashley Sheridan
On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote: Ashley Sheridan wrote: On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote: Only thing to note with the foreach is that you are actually working on a copy of the array, so if you intend to modify it, pass it by reference.

Re: [PHP] while-question

2008-11-17 Thread Craige Leeder
bruce wrote: curious qiestion to all on here who dabble in php... how many of you have actully gone to college, taken algorithm courses, microprocessor courses, design/architecture courses, etc.. or is the majority of the work here from people who've grabbed the tools and started

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
Craige Leeder schreef: bruce wrote: curious qiestion to all on here who dabble in php... how many of you have actully gone to college, taken algorithm courses, microprocessor courses, design/architecture courses, etc.. or is the majority of the work here from people who've grabbed the

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
tedd schreef: At 10:00 AM -0800 11/17/08, bruce wrote: curious qiestion to all on here who dabble in php... how many of you have actully gone to college, taken algorithm courses, microprocessor courses, design/architecture courses, etc.. or is the majority of the work here from people

Re: [PHP] while-question

2008-11-17 Thread Craige Leeder
Jochem Maas wrote: must . resist I take you didn't score to hig on the spelling test? and collage, is that the the cut-n-paste school of IT? dang it, failed. ;-) Haha! 'high' was just my 'h' key not pressing, and college is just one of those words I have trouble with.

Re: [PHP] while question

2008-11-17 Thread Jochem Maas
Craige Leeder schreef: Ashley Sheridan wrote: On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote: Only thing to note with the foreach is that you are actually working on a copy of the array, so if you intend to modify it, pass it by reference. - Craige Can you do that? I

Re: [PHP] while-question

2008-11-17 Thread tedd
At 12:52 AM +0100 11/18/08, Jochem Maas wrote: Craige Leeder schreef: I'm 100% self taught for now. I'm just out of higschool, and hopefully going off to collage next year. must . resist I take you didn't score to hig on the spelling test? and collage, is that the the

Re: [PHP] while-question

2008-11-17 Thread tedd
At 7:02 PM -0500 11/17/08, Craige Leeder wrote: I'm not illiterate; promise :p - Craige Yeah, his parents were married before he was born. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] while question

2008-11-17 Thread Micah Gersten
Jay Blanchard wrote: [snip] ...foreach... [/snip] You could also use a for loop if you wanted to count; for($i = 0; $i count($array); $i++){ echo $i . \n; } This is not good because you are calling count every loop iteration. Thank you, Micah Gersten onShore Networks Internal

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
tedd schreef: At 12:52 AM +0100 11/18/08, Jochem Maas wrote: Craige Leeder schreef: I'm 100% self taught for now. I'm just out of higschool, and hopefully going off to collage next year. must . resist I take you didn't score to hig on the spelling test? and collage, is that

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
Craige Leeder schreef: Jochem Maas wrote: must . resist I take you didn't score to hig on the spelling test? and collage, is that the the cut-n-paste school of IT? dang it, failed. ;-) Haha! 'high' was just my 'h' key not pressing, and college is just one of those