Re: [PHP] Javascript question

2009-03-02 Thread Robert Cummings
On Mon, 2009-03-02 at 16:11 -0600, Boyd, Todd M. wrote: Before some of you newbies feel like being heroes and jump all over me: I KNOW THIS IS A PHP-RELATED LIST. IF YOU DON'T LIKE MY QUESTION, DON'T ANSWER IT. Now that that's out of the way... I have a Javascript question (and maybe a

RE: [PHP] Javascript question

2009-03-02 Thread Boyd, Todd M.
-Original Message- From: Robert Cummings [mailto:rob...@interjinn.com] Sent: Monday, March 02, 2009 4:18 PM To: Boyd, Todd M. Cc: PHP General list Subject: Re: [PHP] Javascript question On Mon, 2009-03-02 at 16:11 -0600, Boyd, Todd M. wrote: Before some of you newbies feel like

RE: [PHP] Javascript question

2009-03-02 Thread Boyd, Todd M.
-Original Message- From: Michael A. Peters [mailto:mpet...@mac.com] Sent: Monday, March 02, 2009 4:42 PM To: Boyd, Todd M. Cc: PHP General list Subject: Re: [PHP] Javascript question Boyd, Todd M. wrote: Before some of you newbies feel like being heroes and jump all over me

Re: [PHP] Javascript question

2009-03-02 Thread Michael A. Peters
Boyd, Todd M. wrote: Before some of you newbies feel like being heroes and jump all over me: I KNOW THIS IS A PHP-RELATED LIST. IF YOU DON'T LIKE MY QUESTION, DON'T ANSWER IT. Now that that's out of the way... I have a Javascript question (and maybe a Browser/DOM question) for you folks. I'm

Re: [PHP] preg_match question...

2009-02-06 Thread Alpár Török
preg_match('/^([0-9]+) (.)+/',$sString,$aMatches); Matches will be 1 = the number ; 2 = the text. The expression only matches if there is any character after the space. Not necessarily text, it might be another number or special characters 2009/2/6 bruce bedoug...@earthlink.net hi... trying

Re: [PHP] preg_match question...

2009-02-06 Thread Jim Lucas
bruce wrote: hi... trying to figure out the best approach to using preg_match to extract the number from the follwing type of line... 131646 sometext follows.. basically, i want to extract the number, without the text, but i have to be able to match on the text i've been playing

Re: [PHP] function_exists question

2009-02-05 Thread Thodoris
Is there a way to check not only if a function exists, but also to check that the number and types of parameters desired match a function definition? The reason being that additional options have been added in php 4 and 5 to various standard function calls, but I'm still running a php3 and

Re: [PHP] function_exists question

2009-02-05 Thread German Geek
Why can't you update to Version 5? I might be a bit anal about trying to always get the newest version of everything, but seriously version 3 has surely more known security issues as well as performance costs. What's the cost of upgrading compared to the cost of writing code that works in every

RE: [PHP] function_exists question

2009-02-05 Thread Boyd, Todd M.
-Original Message- From: th.he...@gmail.com [mailto:th.he...@gmail.com] On Behalf Of German Geek Sent: Thursday, February 05, 2009 5:02 PM To: t...@kinetix.gr Cc: Matt Pagel; php-general@lists.php.net Subject: Re: [PHP] function_exists question Why can't you update to Version 5

Re: [PHP] function_exists question

2009-02-05 Thread Chris
How about this PHP developers: You could make a global variable (or constant) the user can set like define('PHP_COMPATIBLE_VERSION', '5.0.1'); or something to tell PHP 6 to interpret it like PHP 5.x . That way, at least you are guaranteed that the code will work like on that version. It might

RE: [PHP] Payment question in Canada

2009-01-31 Thread Ernie Kemp
Thanks for your replies. Very useful... /Ernie -Original Message- From: farn...@googlemail.com [mailto:farn...@googlemail.com] On Behalf Of Edmund Hertle Sent: January-30-09 4:47 PM To: Bastien Koert Cc: Ernie Kemp; php-general@lists.php.net Subject: Re: [PHP] Payment question

Re: [PHP] Payment question in Canada

2009-01-31 Thread Daniel Brown
On Sat, Jan 31, 2009 at 13:44, Ernie Kemp ernie.k...@sympatico.ca wrote: Thanks for your replies. Very useful... /Ernie Please don't top-post. This question doesn't have a direct answer. Three major things come into play: first, the type and scope of work involved; second, your

Re: [PHP] Payment question in Canada

2009-01-30 Thread Bastien Koert
On Fri, Jan 30, 2009 at 2:11 PM, Ernie Kemp ernie.k...@sympatico.ca wrote: My question is one of pay; hope this is the correct forum. A couple of people have asked me to write some PHP code for their website backend. I need the money from this but I don't know what to charge them. I

Re: [PHP] Payment question in Canada

2009-01-30 Thread Edmund Hertle
2009/1/30 Bastien Koert phps...@gmail.com On Fri, Jan 30, 2009 at 2:11 PM, Ernie Kemp ernie.k...@sympatico.ca wrote: My question is one of pay; hope this is the correct forum. A couple of people have asked me to write some PHP code for their website backend. I need the

Re: [PHP] Cookie Question

2009-01-17 Thread Török Alpár
2009/1/17 PHP php_l...@ibcnetwork.net Hi, I am trying to get a cookie to set in Internet Explorer 7, I have tried several different setcookie() configurations, this is the latest. Yes, I read the manual and the user notes, but can't find anything specific about the different security levels

Re: [PHP] Cookie Question

2009-01-17 Thread PHP
Oops, copy and paste error, that is the cookie I was using to delete. The one I am using to set is acutally: setcookie($szCookieName, $nID, time()+$expireTime,/,www.mysite.com,false); 2009/1/17 PHP php_l...@ibcnetwork.net Hi, I am trying to get a cookie to set in Internet Explorer 7, I

Re: [PHP] preg_match_all question

2009-01-16 Thread Robert Cummings
On Fri, 2009-01-16 at 09:42 +, Phil Ewington - iModel Ltd. wrote: Hi All, Having an issue with regular expressions, never been my strong point! The following pattern only picks up one instance per line, if more than one instance exists all text from first {{ to last }} is included,

Re: [PHP] preg_match_all question

2009-01-16 Thread Phil Ewington - iModel Ltd.
Robert Cummings wrote: On Fri, 2009-01-16 at 09:42 +, Phil Ewington - iModel Ltd. wrote: Hi All, Having an issue with regular expressions, never been my strong point! The following pattern only picks up one instance per line, if more than one instance exists all text from first {{ to

RE: [PHP] preg_match_all question

2009-01-16 Thread Boyd, Todd M.
-Original Message- From: Robert Cummings [mailto:rob...@interjinn.com] Sent: Friday, January 16, 2009 4:31 AM To: Phil Ewington - iModel Ltd. Cc: php-general@lists.php.net Subject: Re: [PHP] preg_match_all question On Fri, 2009-01-16 at 09:42 +, Phil Ewington - iModel Ltd

RE: [PHP] preg_match_all question

2009-01-16 Thread Boyd, Todd M.
-Original Message- From: Boyd, Todd M. [mailto:tmbo...@ccis.edu] Sent: Friday, January 16, 2009 2:13 PM To: php-general@lists.php.net Subject: RE: [PHP] preg_match_all question -Original Message- From: Robert Cummings [mailto:rob...@interjinn.com] Sent: Friday, January

Re: [PHP] Security question

2009-01-15 Thread Frank Stanovcak
VamVan vamsee...@gmail.com wrote in message news:12eb8b030901141421u6741b943q396bc784136b7...@mail.gmail.com... On Wed, Jan 14, 2009 at 2:22 PM, Frank Stanovcak blindspot...@comcast.netwrote: This is mostly to make sure I understand how sessions are handled correctly. As far as sessions

Re: [PHP] Security question

2009-01-15 Thread Micah Gersten
Frank Stanovcak wrote: VamVan vamsee...@gmail.com wrote in message news:12eb8b030901141421u6741b943q396bc784136b7...@mail.gmail.com... On Wed, Jan 14, 2009 at 2:22 PM, Frank Stanovcak blindspot...@comcast.netwrote: This is mostly to make sure I understand how sessions are handled

Re: [PHP] Security question

2009-01-14 Thread VamVan
On Wed, Jan 14, 2009 at 2:22 PM, Frank Stanovcak blindspot...@comcast.netwrote: This is mostly to make sure I understand how sessions are handled correctly. As far as sessions are concerned the variable data is stored on the server (be it in memory or temp files), and never transmitted

Re: [PHP] system() Question

2009-01-01 Thread Nathan Nobbe
On Thu, Jan 1, 2009 at 12:01 AM, Daniel Brown danbr...@php.net wrote: On Thu, Jan 1, 2009 at 01:57, Jim Lucas li...@cmsws.com wrote: Getting in some practice for new little one? :) Damn kids ;-P Happy New Year to all, and to all a safe night! To you as well, Mr. Lucas!

Re: [PHP] Quick question regarding debugging and PHP structure.

2009-01-01 Thread Nathan Rixham
Ashley Sheridan wrote: On Wed, 2008-12-31 at 20:41 +, Ólafur Waage wrote: Short: Is it possible to see the PHP code that is going to be processed in whole? Long: I love to see things visually, and while programming i create all kinds of debugging variables i keep on the side for each

Re: [PHP] Quick question regarding debugging and PHP structure.

2008-12-31 Thread Ashley Sheridan
On Wed, 2008-12-31 at 20:41 +, Ólafur Waage wrote: Short: Is it possible to see the PHP code that is going to be processed in whole? Long: I love to see things visually, and while programming i create all kinds of debugging variables i keep on the side for each page/request. I know

Re: [PHP] system() Question

2008-12-31 Thread Micah Gersten
Nathan Nobbe wrote: On Sun, Dec 28, 2008 at 8:40 PM, Micah Gersten mi...@onshore.com mailto:mi...@onshore.com wrote: Nathan Nobbe wrote: good point dan, and just to add further clarification, thats b/c the function specifies $return_var is passed by reference in the formal

Re: [PHP] system() Question

2008-12-31 Thread Nathan Nobbe
On Wed, Dec 31, 2008 at 7:03 PM, Micah Gersten mi...@onshore.com wrote: Nathan Nobbe wrote: On Sun, Dec 28, 2008 at 8:40 PM, Micah Gersten mi...@onshore.com mailto:mi...@onshore.com wrote: Nathan Nobbe wrote: good point dan, and just to add further clarification, thats b/c

Re: [PHP] system() Question

2008-12-31 Thread Daniel Brown
On Wed, Dec 31, 2008 at 21:29, Nathan Nobbe quickshif...@gmail.com wrote: On Wed, Dec 31, 2008 at 7:03 PM, Micah Gersten mi...@onshore.com wrote: I think I was confused here about your response. After re-reading a few times, I see that you were enhancing Dan's response by explaining what

Re: [PHP] system() Question

2008-12-31 Thread Jim Lucas
Daniel Brown wrote: On Wed, Dec 31, 2008 at 21:29, Nathan Nobbe quickshif...@gmail.com wrote: On Wed, Dec 31, 2008 at 7:03 PM, Micah Gersten mi...@onshore.com wrote: I think I was confused here about your response. After re-reading a few times, I see that you were enhancing Dan's response by

Re: [PHP] system() Question

2008-12-31 Thread Daniel Brown
On Thu, Jan 1, 2009 at 01:57, Jim Lucas li...@cmsws.com wrote: Getting in some practice for new little one? :) Damn kids ;-P Happy New Year to all, and to all a safe night! To you as well, Mr. Lucas! And now that I am done with work (for the most part), this is my official

Re: [PHP] mysql question

2008-12-29 Thread Phpster
The mysql forum is the best place. Note that their holiday schedule may mean some lag in getting answers. Bastien Sent from my iPod On Dec 29, 2008, at 7:51 AM, ann kok oiyan...@yahoo.ca wrote: Hi all Do you know any websites for mysql question? I do submit the mysql forum but I would

Re: [PHP] system() Question

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 12:40 PM, Ryan O'Sullivan r...@rynet.com wrote: Hello all, I am using system to convert some files using a binary in linux. My code looks like this: $response = system('gpsbabel -p -r -t -i gpx -f test.gpx -o kml -F test2.kml', $retval); echo pResponse: ,

Re: [PHP] system() Question

2008-12-28 Thread Rick Pasotto
On Sun, Dec 28, 2008 at 12:40 PM, Ryan O'Sullivan r...@rynet.com wrote: Hello all, I am using system to convert some files using a binary in linux. My code looks like this: $response = system('gpsbabel -p -r -t -i gpx -f test.gpx -o kml -F test2.kml', $retval); echo pResponse: ,

Re: [PHP] system() Question

2008-12-28 Thread Daniel Brown
On Sun, Dec 28, 2008 at 18:10, Rick Pasotto r...@niof.net wrote: You overlooked the ampersand in front of $retval. The syntax for 'system' is: string system ( string $command [, int $return_var ] ) You have to pass a pointer to the variable, not the variable itself. Actually, that's

Re: [PHP] system() Question

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 6:49 PM, Daniel Brown danbr...@php.net wrote: On Sun, Dec 28, 2008 at 18:10, Rick Pasotto r...@niof.net wrote: You overlooked the ampersand in front of $retval. The syntax for 'system' is: string system ( string $command [, int $return_var ] ) You have to

Re: [PHP] system() Question

2008-12-28 Thread Micah Gersten
Nathan Nobbe wrote: good point dan, and just to add further clarification, thats b/c the function specifies $return_var is passed by reference in the formal parameter. when you include the along w/ an actual parameter (during function invocation) thats referred to as

Re: [PHP] system() Question

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 8:40 PM, Micah Gersten mi...@onshore.com wrote: Nathan Nobbe wrote: good point dan, and just to add further clarification, thats b/c the function specifies $return_var is passed by reference in the formal parameter. when you include the along w/ an actual

Re: [PHP] fread question

2008-12-18 Thread MikeP
From my phpinfo: magic_quotes_runtime Off Robert Cummings rob...@interjinn.com wrote in message news:1229567238.8302.35.ca...@localhost... On Wed, 2008-12-17 at 19:54 -0500, MikeP wrote: Hello, I have been trying to use fread to open a file, but it always escapes special characters.

Re: [PHP] fread question

2008-12-18 Thread MikeP
But this one is ON magic_quotes_gpc Robert Cummings rob...@interjinn.com wrote in message news:1229567238.8302.35.ca...@localhost... On Wed, 2008-12-17 at 19:54 -0500, MikeP wrote: Hello, I have been trying to use fread to open a file, but it always escapes special characters. How do I open

Re: [PHP] fread question

2008-12-18 Thread MikeP
Still having problems: magic_quotes_runtime is off BUT magic_quotes_gpc is on I cant change them myself so I tried stripslashes That doesnt work though: $_POST[$fname] = fread($fileHandle, $_POST[$fname.'_size']); $test=$_POST[$fname]; $test3=stripslashes($test); $test3 and $test are the

RE: [PHP] fread question

2008-12-18 Thread Boyd, Todd M.
-Original Message- From: MikeP [mailto:mpel...@princeton.edu] Sent: Thursday, December 18, 2008 7:33 AM To: php-general@lists.php.net Subject: Re: [PHP] fread question Still having problems: magic_quotes_runtime is off BUT magic_quotes_gpc is on I cant change them myself so I

RE: [PHP] fread question

2008-12-18 Thread Boyd, Todd M.
Hah! Forgot to add the link: 1. http://php.net/ini_set How would you guys have ever figured out that was the page on PHP's website you need to visit in order to view information about the ini_set() function?! ;) // Todd -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] fread question

2008-12-18 Thread ceo
PHP does *not* do the addslashes on $_POST when you cram something into it in your PHP code. It does it during the process of auto-filling up $_POST. So either: A) you have magic_quotes_runtime turned on LOCALLY. Use phpinfo() to see. B) you actually managed to put the backslashes into

Re: [PHP] fread question

2008-12-18 Thread MikeP
you have magic_quotes_runtime turned on LOCALLY. Use phpinfo() to see. NOmagic_quotes_runtime Off you actually managed to put the backslashes into your text file. NO tdinput name=letter type=file id=letter size=50 maxlength=255 / . . . . ?php process_uploaded_file('letter'); function

Re: [PHP] fread question

2008-12-17 Thread Robert Cummings
On Wed, 2008-12-17 at 19:54 -0500, MikeP wrote: Hello, I have been trying to use fread to open a file, but it always escapes special characters. How do I open afile without it modifying my original file: $_POST[$fname] = fread($fileHandle, $_POST[$fname.'_size']); I use this and get

Re: [PHP] Quick question regarding $_SESSION and header()

2008-12-11 Thread Dan Joseph
On Thu, Dec 11, 2008 at 2:01 PM, Ólafur Waage olaf...@gmail.com wrote: I should be able to set a session var and then do a header redirect right? Small bug regarding that and i just need to be sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Quick question regarding $_SESSION and header()

2008-12-11 Thread Daniel Brown
On Thu, Dec 11, 2008 at 14:01, Ólafur Waage olaf...@gmail.com wrote: I should be able to set a session var and then do a header redirect right? Small bug regarding that and i just need to be sure. This isn't a bug in PHP, it's actually in adherance with HTTP standards (and current browser

[PHP] Re: [PHP-QA] Re: [PHP] Quick question regarding $_SESSION and header()

2008-12-11 Thread Daniel Brown
(Forwarding back to PHP General for the archives.) On Thu, Dec 11, 2008 at 14:31, Ólafur Waage olaf...@gmail.com wrote: Its fixed, thanks guys :) On Thu, Dec 11, 2008 at 7:16 PM, Daniel Brown danbr...@php.net wrote: On Thu, Dec 11, 2008 at 14:01, Ólafur Waage olaf...@gmail.com wrote: I

[PHP] Re: [PHP-QA] Re: [PHP] Quick question regarding $_SESSION and header()

2008-12-11 Thread Ólafur Waage
Whoops, sent the thanks to the wrong list :P On Thu, Dec 11, 2008 at 7:33 PM, Daniel Brown danbr...@php.net wrote: (Forwarding back to PHP General for the archives.) On Thu, Dec 11, 2008 at 14:31, Ólafur Waage olaf...@gmail.com wrote: Its fixed, thanks guys :) On Thu, Dec 11, 2008 at 7:16

Re: [PHP] array_intersect question

2008-12-10 Thread German Geek
On Tue, Dec 2, 2008 at 11:06 PM, Andrej Kastrin [EMAIL PROTECTED]wrote: It works like a charm. Thanks, Andrej Tim | iHostNZ wrote: I know there must be a more elegant way with array_reduce or something, but I would simply write a function called function array_intersect_m($m_array) {

Re: [PHP] array_intersect question

2008-12-02 Thread Tim | iHostNZ
I know there must be a more elegant way with array_reduce or something, but I would simply write a function called function array_intersect_m($m_array) { $intersection = $m_array[0]; for ($i=1; $i count($m_array); $i++) { $intersection = array_intersect($m_array[$i], $intersection); }

Re: [PHP] array_intersect question

2008-12-02 Thread Andrej Kastrin
It works like a charm. Thanks, Andrej Tim | iHostNZ wrote: I know there must be a more elegant way with array_reduce or something, but I would simply write a function called function array_intersect_m($m_array) { $intersection = $m_array[0]; for ($i=1; $i count($m_array); $i++) {

Re: [PHP] array_intersect question

2008-12-02 Thread Yeti
The question is how to perform intersection on the following structure: $products = array(array(green,red,blue),array(green,yellow,red),array(green,red,purple),array(green,red,yellow)); If I understood you correctly .. ?php $arr = array(); $arr[] = array(green, red, blue); $arr[] =

Re: [PHP] [php] question about ob_end_flush

2008-11-27 Thread Robert Cummings
On Fri, 2008-11-28 at 12:01 +0800, jason liang wrote: Hi all I am comfused about the function ob_end_flush.In the manual:This function will send the contents of the topmost output buffer (if any) and turn this output buffer off. i have made such tests. ?php ob_start(); echo

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] Another question about Google maps

2008-11-17 Thread Boyd, Todd M.
-Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Saturday, November 15, 2008 2:11 PM To: php-general@lists.php.net Subject: [PHP] Another question about Google maps Hi gang: I posted this question on the Google Map Discussion group/list thingie, but got zip in

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] Another question about Google maps

2008-11-17 Thread tedd
At 8:37 AM -0600 11/17/08, Boyd, Todd M. wrote: tedd, I think it might be displaying your extra divs (if there are any.. just skimmed the source momentarily) for a split second before they are hidden with Javascript. Maybe try setting the CSS for your 3 map divs (mapsearch, idlediv, searchdiv or

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

<    1   2   3   4   5   6   7   8   9   10   >