Re: [PHP] array key's: which is correct?

2010-06-08 Thread Robert Cummings
Tanel Tammik wrote: Hi, which one is correct or better? $array[3] = ''; or $array['3'] = ''; $i = 7; $array[$i] = ''; or $array[$i] = ''; Sometimes it is good to illustrate the correct answer: ?php $array = array ( '1' = '1', '2' = '2', 'three' = 'three', '4.0

Re: [PHP] array key's: which is correct?

2010-06-08 Thread Ashley Sheridan
On Tue, 2010-06-08 at 09:38 -0400, Robert Cummings wrote: Tanel Tammik wrote: Hi, which one is correct or better? $array[3] = ''; or $array['3'] = ''; $i = 7; $array[$i] = ''; or $array[$i] = ''; Sometimes it is good to illustrate the correct answer: ?php

Re: [PHP] array key's: which is correct?

2010-06-08 Thread Paul M Foster
On Tue, Jun 08, 2010 at 09:38:58AM -0400, Robert Cummings wrote: Tanel Tammik wrote: Hi, which one is correct or better? $array[3] = ''; or $array['3'] = ''; $i = 7; $array[$i] = ''; or $array[$i] = ''; Sometimes it is good to illustrate the correct answer: ?php $array = array

Re: [PHP] array key's: which is correct?

2010-06-08 Thread Ashley Sheridan
] = ''; Sometimes it is good to illustrate the correct answer: ?php $array = array ( '1' = '1', '2' = '2', 'three' = 'three', '4.0' = '4.0', 5.0 = 5.0, ); var_dump( array_keys( $array ) ); ? The answer is surprising (well, not really

Re: [PHP] array key's: which is correct?

2010-06-08 Thread Peter Lind
'] = ''; $i = 7; $array[$i] = ''; or $array[$i] = ''; Sometimes it is good to illustrate the correct answer: ?php $array = array (     '1'     = '1',     '2'     = '2',     'three' = 'three',     '4.0'   = '4.0',     5.0     = 5.0, ); var_dump( array_keys

Re: [PHP] array key's: which is correct?

2010-06-08 Thread Ashley Sheridan
one is correct or better? $array[3] = ''; or $array['3'] = ''; $i = 7; $array[$i] = ''; or $array[$i] = ''; Sometimes it is good to illustrate the correct answer: ?php $array = array ( '1' = '1', '2' = '2', 'three

Re: [PHP] array key's: which is correct?

2010-06-08 Thread Peter Lind
-0400, Robert Cummings wrote: Tanel Tammik wrote: Hi, which one is correct or better? $array[3] = ''; or $array['3'] = ''; $i = 7; $array[$i] = ''; or $array[$i] = ''; Sometimes it is good to illustrate the correct answer: ?php $array

Re: [PHP] array key's: which is correct?

2010-06-08 Thread Ashley Sheridan
] = ''; Sometimes it is good to illustrate the correct answer: ?php $array = array ( '1' = '1', '2' = '2', 'three' = 'three', '4.0' = '4.0', 5.0 = 5.0, ); var_dump( array_keys( $array ) ); ? The answer

Re: [PHP] array key's: which is correct?

2010-06-08 Thread Paul M Foster
, which one is correct or better? $array[3] = ''; or $array['3'] = ''; $i = 7; $array[$i] = ''; or $array[$i] = ''; Sometimes it is good to illustrate the correct answer: ?php $array = array (     '1'     = '1',     '2'     = '2',     'three

Re: [PHP] array key's: which is correct?

2010-06-08 Thread Robert Cummings
wrote: Hi, which one is correct or better? $array[3] = ''; or $array['3'] = ''; $i = 7; $array[$i] = ''; or $array[$i] = ''; Sometimes it is good to illustrate the correct answer: ?php $array = array ( '1' = '1', '2' = '2', 'three' = 'three', '4.0' = '4.0', 5.0

[PHP] Array group and sum values.

2010-05-11 Thread Paul Halliday
I have this: while ($row = mysql_fetch_array($theData[0])) { $col1[] = $row[0]; $col2[] = lookup($row[1]); // this goes off and gets the country name. I then loop through col1 and col2 to produce something like this: 52 ARMENIA 215 CANADA 57 CANADA 261 COLOMBIA 53

Re: [PHP] Array group and sum values.

2010-05-11 Thread Jim Lucas
Paul Halliday wrote: I have this: while ($row = mysql_fetch_array($theData[0])) { $col1[] = $row[0]; $col2[] = lookup($row[1]); // this goes off and gets the country name. I then loop through col1 and col2 to produce something like this: 52ARMENIA 215 CANADA 57

Re: [PHP] Array group and sum values.

2010-05-11 Thread Paul Halliday
On Tue, May 11, 2010 at 2:25 PM, Jim Lucas li...@cmsws.com wrote: Paul Halliday wrote: I have this: while ($row = mysql_fetch_array($theData[0])) {     $col1[] = $row[0];     $col2[] = lookup($row[1]); // this goes off and gets the country name. I then loop through col1 and col2 to

Re: [PHP] Array group and sum values.

2010-05-11 Thread Jim Lucas
Paul Halliday wrote: On Tue, May 11, 2010 at 2:25 PM, Jim Lucas li...@cmsws.com wrote: Paul Halliday wrote: I have this: while ($row = mysql_fetch_array($theData[0])) { $col1[] = $row[0]; $col2[] = lookup($row[1]); // this goes off and gets the country name. I then loop through

Re: [PHP] Array group and sum values.

2010-05-11 Thread Paul Halliday
On Tue, May 11, 2010 at 4:03 PM, Jim Lucas li...@cmsws.com wrote: Paul Halliday wrote: On Tue, May 11, 2010 at 2:25 PM, Jim Lucas li...@cmsws.com wrote: Paul Halliday wrote: I have this: while ($row = mysql_fetch_array($theData[0])) {     $col1[] = $row[0];     $col2[] = lookup($row[1]);

Re: [PHP] Array group and sum values.

2010-05-11 Thread Shawn McKenzie
On 05/11/2010 02:17 PM, Paul Halliday wrote: On Tue, May 11, 2010 at 4:03 PM, Jim Lucas li...@cmsws.com wrote: Paul Halliday wrote: On Tue, May 11, 2010 at 2:25 PM, Jim Lucas li...@cmsws.com wrote: Paul Halliday wrote: I have this: while ($row = mysql_fetch_array($theData[0])) {

Re: [PHP] Array group and sum values.

2010-05-11 Thread Shawn McKenzie
On 05/11/2010 04:09 PM, Shawn McKenzie wrote: On 05/11/2010 02:17 PM, Paul Halliday wrote: On Tue, May 11, 2010 at 4:03 PM, Jim Lucas li...@cmsws.com wrote: Paul Halliday wrote: On Tue, May 11, 2010 at 2:25 PM, Jim Lucas li...@cmsws.com wrote: Paul Halliday wrote: I have this: while ($row

[PHP] Array to csv or excel in php

2010-04-19 Thread Manolis Vlachakis
hallo there everyone.. i got an array from my database Help with Code Tagshttp://www.daniweb.com/forums/misc-explaincode.html?TB_iframe=trueheight=400width=680 *PHP Syntax* (Toggle Plain Texthttp://www.daniweb.com/forums/post1194347.html# ) 1. $save=split([|;],$listOfItems); and what i

Re: [PHP] Array to csv or excel in php

2010-04-19 Thread Andrew Ballard
On Mon, Apr 19, 2010 at 9:45 AM, Manolis Vlachakis vlachakis.mano...@gmail.com wrote: hallo there everyone.. i got an array from my database Help with Code Tagshttp://www.daniweb.com/forums/misc-explaincode.html?TB_iframe=trueheight=400width=680 *PHP Syntax* (Toggle Plain

Re: [PHP] Array to csv or excel in php

2010-04-19 Thread Peter Lind
On 19 April 2010 17:00, Andrew Ballard aball...@gmail.com wrote: On Mon, Apr 19, 2010 at 9:45 AM, Manolis Vlachakis vlachakis.mano...@gmail.com wrote: hallo there everyone.. i got an array from my database Help with Code

Re: [PHP] Array to csv or excel in php

2010-04-19 Thread Andrew Ballard
On Mon, Apr 19, 2010 at 11:14 AM, Peter Lind peter.e.l...@gmail.com wrote: On 19 April 2010 17:00, Andrew Ballard aball...@gmail.com wrote: On Mon, Apr 19, 2010 at 9:45 AM, Manolis Vlachakis 1. $save=split([|;],$listOfItems); and what i want i s after making some changes to the attributes

Re: [PHP] Array to csv or excel in php

2010-04-19 Thread Peter Lind
On 19 April 2010 17:40, Andrew Ballard aball...@gmail.com wrote: On Mon, Apr 19, 2010 at 11:14 AM, Peter Lind peter.e.l...@gmail.com wrote: On 19 April 2010 17:00, Andrew Ballard aball...@gmail.com wrote: On Mon, Apr 19, 2010 at 9:45 AM, Manolis Vlachakis   1. $save=split([|;],$listOfItems);

Re: [PHP] Array to csv or excel in php

2010-04-19 Thread Ken Guest
For non-simple data I have been using PEAR's File_CSV package. It's proven itself very useful in regards to not having to determine in my own code whether something needs to be quoted etc etc - especially if the output CSV needs to be wholly RFC 4180 compliant. The documentation of it is rather

RE: [PHP] Array to csv or excel in php

2010-04-19 Thread Jay Blanchard
[snip] to export them on an csv or excel format[/snip] Stupid browser tricks http://www.evolt.org/node/26896 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array differences

2010-04-14 Thread Ashley Sheridan
On Tue, 2010-04-13 at 23:01 -0600, Ashley M. Kirchner wrote: I have the following scenario: $array1 = array(12, 34, 56, 78, 90); $array2 = array(12, 23, 56, 78, 89); $result = array_diff($array1, $array2); print_r($result); This returns:

Re: [PHP] Array differences

2010-04-14 Thread Nathan Rixham
Ashley Sheridan wrote: On Tue, 2010-04-13 at 23:01 -0600, Ashley M. Kirchner wrote: However what I really want is a two-way comparison. I want elements that don't exist in either to be returned: I don't see any problems with doing it that way. By some freak chance I made an array diff

Re: [PHP] Array differences

2010-04-14 Thread Rene Veerman
On Wed, Apr 14, 2010 at 12:03 PM, Nathan Rixham nrix...@gmail.com wrote: Ashley Sheridan wrote: On Tue, 2010-04-13 at 23:01 -0600, Ashley M. Kirchner wrote: However what I really want is a two-way comparison.  I want elements that don't exist in either to be returned: I don't see any

Re: [PHP] Array differences

2010-04-14 Thread Ashley M. Kirchner
On 4/14/2010 2:39 AM, Ashley Sheridan wrote: On Tue, 2010-04-13 at 23:01 -0600, Ashley M. Kirchner wrote: $array1 = array(12, 34, 56, 78, 90); $array2 = array(12, 23, 56, 78, 89); $diff1 = array_diff($array1, $array2); $diff2 = array_diff($array2, $array1);

Re: [PHP] Array differences

2010-04-14 Thread Ryan Sun
Maybe this one works? array_diff(array_unique($array1 + $array2), array_intersect($array1, $array2)) On Wed, Apr 14, 2010 at 4:39 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Tue, 2010-04-13 at 23:01 -0600, Ashley M. Kirchner wrote: I have the following scenario:      $array1 =

RE: [PHP] Array differences

2010-04-14 Thread Ashley M. Kirchner
Sun [mailto:ryansu...@gmail.com] Sent: Wednesday, April 14, 2010 8:45 AM To: a...@ashleysheridan.co.uk Cc: Ashley M. Kirchner; php-general@lists.php.net Subject: Re: [PHP] Array differences Maybe this one works? array_diff(array_unique($array1 + $array2), array_intersect($array1, $array2

Re: [PHP] Array differences

2010-04-14 Thread lala
Ashley M. Kirchner wrote: $array1 = array(1, 2, 3, 4, 5, 6); $array2 = array(1, 3, 2, 8, 9); $diff1 = array_diff($array1, $array2); $diff2 = array_diff($array2, $array1); $result = array_unique(array_merge($diff1, $diff2)); = (4, 5, 6, 8, 9)

RE: [PHP] Array differences

2010-04-14 Thread Ashley M. Kirchner
-Original Message- From: lala [mailto:l...@mail.theorb.net] Sent: Wednesday, April 14, 2010 10:15 AM To: Ashley M. Kirchner Cc: php-general@lists.php.net Subject: Re: [PHP] Array differences Ashley M. Kirchner wrote: $array1 = array(1, 2, 3, 4, 5, 6); $array2 = array

[PHP] Array differences

2010-04-13 Thread Ashley M. Kirchner
I have the following scenario: $array1 = array(12, 34, 56, 78, 90); $array2 = array(12, 23, 56, 78, 89); $result = array_diff($array1, $array2); print_r($result); This returns: Array ( [1] = 34 [4] = 90 )

Re: [PHP] Array differences

2010-04-13 Thread Rene Veerman
On Wed, Apr 14, 2010 at 7:01 AM, Ashley M. Kirchner ash...@pcraft.com wrote: I have the following scenario:     $array1 = array(12, 34, 56, 78, 90);     $array2 = array(12, 23, 56, 78, 89);     $result = array_diff($array1, $array2);     print_r($result); This returns:    

[PHP] array or list of objects of different types

2010-04-02 Thread Php Developer
Hi all, I want to be able to have an array of elements of different types. As an example: the first element is a boolean, the second is an integer, and the thirs is a string. In php there is no typing, i'm just wondering if there is a way to have that, it would be a lot better than having an

RE: [PHP] Array Search Problem

2010-03-11 Thread Alice Wei
direction. Alice From: rene7...@gmail.com Date: Thu, 11 Mar 2010 07:12:15 +0100 Subject: Re: [PHP] Array Search Problem To: aj...@alumni.iu.edu CC: php-general@lists.php.net (almost) all the tricks are in the comments of the help page for a function, on php.net but all functions accept

[PHP] Array Search Problem

2010-03-10 Thread Alice Wei
Hi, I have the code as shown in the following that I am trying to create the image of based on the file loaded into the file and additional edits. The problem here appears to be that no matter what value I have in the $distance_to_destination variable, it does not affect any changes on the

[PHP] Array Search Not Working?

2010-03-10 Thread Alice Wei
Hi, I have two arrays here that I have combined into a new array, as shown here: $from = explode(-, $from); $change = explode(-,$change); $new_array = array_combine($from,$change); I then tried reading it from a file and do string matches, trying to find out the key using the array_search

Re: [PHP] Array Search Problem

2010-03-10 Thread Rene Veerman
did you read the help for those functions on php.net? On Wed, Mar 10, 2010 at 4:12 PM, Alice Wei aj...@alumni.iu.edu wrote: Hi,  I have the code as shown in the following that I am trying to create the image of based on the file loaded into the file and additional edits. The problem here

RE: [PHP] Array Search Problem

2010-03-10 Thread Alice Wei
did you read the help for those functions on php.net? Yes, I found a recursive way to find out the index like I wanted, by doing something like $from = explode(-, $from); $state_colors= explode(-, $state_colors); $change = explode(-,$change); $count = count($new_array); $i=0; foreach

Re: [PHP] Array Search Problem

2010-03-10 Thread Rene Veerman
(almost) all the tricks are in the comments of the help page for a function, on php.net but all functions accept only a given (and usually documented) set of parameter(type)s, so you'll probably have to prepare the var, or even call the function in a loop, outputting to yet another descriptively

Re: [PHP] array conversion

2010-02-20 Thread clancy_1
Or: $a = array ('Cats', 'white', 'Dogs', 'black', 'Mice', 'grey', 'Camels', 'brown'); $b = '';// Just in case it has some leftover value $k = 2* (int) (count ($a)/2); // ensure even no of terms $i = 0; while ($i $k) { $b[$a[$i++]] = $a[$i++];

Re: [PHP] array conversion

2010-02-19 Thread Richard Quadling
On 19 February 2010 07:26, Adam Richardson simples...@gmail.com wrote: Or, function new_arr(array $arr) {    $count = count($arr);    if ($count % 2 != 0) throw new Exception('The new_arr() function requires an even number of elements.');    for ($i = 0; $i $count; $i += 2)    {        

Re: [PHP] array conversion

2010-02-19 Thread tedd
At 10:48 AM + 2/19/10, Richard Quadling wrote: On 19 February 2010 07:26, Adam Richardson simples...@gmail.com wrote: Or, Code fight!!! http://www.webbytedd.com/ccc/array/ After reviewing the entries, mine does not provide any significant difference. I did it as a mental exercise after

Re: [PHP] array conversion

2010-02-19 Thread Richard Quadling
Just wanting to join in. ?php $array = array ( 'key1', 'value1', 'key2', 'value2', ); $result = array(); while(!is_null($result[array_shift($array)] = array_shift($array))); array_pop($result); print_r($result); ? outputs ... Array ( [key1

[PHP] array conversion

2010-02-18 Thread Dasn
Hi guys. How to convert an array like: Array ( [0] = key1 [1] = value1 [2] = key2 [3] = value2 ) to Array ( [key1] = value1 [key2] = value2 ) Is there a built-in function to do this? Please Cc me. :) Thank you in advance. -- PHP General Mailing List

Re: [PHP] array conversion

2010-02-18 Thread Paul M Foster
On Fri, Feb 19, 2010 at 01:20:12PM +0800, Dasn wrote: Hi guys. How to convert an array like: Array ( [0] = key1 [1] = value1 [2] = key2 [3] = value2 ) to Array ( [key1] = value1 [key2] = value2 ) Is there a built-in function to do this? Please Cc me.

Re: [PHP] array conversion

2010-02-18 Thread Larry Garfield
On Thursday 18 February 2010 11:58:28 pm Paul M Foster wrote: On Fri, Feb 19, 2010 at 01:20:12PM +0800, Dasn wrote: Hi guys. How to convert an array like: Array ( [0] = key1 [1] = value1 [2] = key2 [3] = value2 ) to Array ( [key1] = value1

Re: [PHP] array conversion

2010-02-18 Thread Adam Richardson
Or, function new_arr(array $arr) { $count = count($arr); if ($count % 2 != 0) throw new Exception('The new_arr() function requires an even number of elements.'); for ($i = 0; $i $count; $i += 2) { $new_arr[$arr[$i]] = $arr[$i + 1]; } return $new_arr; } $test =

[PHP] Array

2009-10-24 Thread Ron Piggott
The following line gives me an error message when there aren't any values in the array --- how do I accommodate this? Warning: Invalid argument supplied for foreach() foreach ($_SESSION['order'] AS $key = $value ) { -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Array

2009-10-24 Thread Ashley Sheridan
On Sat, 2009-10-24 at 06:57 -0400, Ron Piggott wrote: The following line gives me an error message when there aren't any values in the array --- how do I accommodate this? Warning: Invalid argument supplied for foreach() foreach ($_SESSION['order'] AS $key = $value ) { Do an

Re: [PHP] Array

2009-10-24 Thread Martin Scotta
On Sat, Oct 24, 2009 at 7:59 AM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Sat, 2009-10-24 at 06:57 -0400, Ron Piggott wrote: The following line gives me an error message when there aren't any values in the array --- how do I accommodate this? Warning: Invalid argument supplied

Re: [PHP] Array

2009-10-24 Thread Ron Piggott
To: a...@ashleysheridan.co.uk Cc: ron.pigg...@actsministries.org, PHP General php-general@lists.php.net Subject: Re: [PHP] Array Date: Sat, 24 Oct 2009 11:50:14 -0300 On Sat, Oct 24, 2009 at 7:59 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Sat, 2009-10-24 at 06:57 -0400, Ron Piggott wrote

Re: [PHP] Array

2009-10-24 Thread Ron Piggott
Subject: Re: [PHP] Array Date: Sat, 24 Oct 2009 11:43:12 -0400 The code I have so far for orders is below. When a product hasn't been added it does what I want it to --- in giving the message Your shopping cart is empty. When a product is added, but then the user changes their mind I use

Re: [PHP] Array

2009-10-24 Thread Shawn McKenzie
Ron Piggott wrote: The code I have so far for orders is below. When a product hasn't been added it does what I want it to --- in giving the message Your shopping cart is empty. When a product is added, but then the user changes their mind I use the following lines of code to remove the

Re: [PHP] Array

2009-10-24 Thread Jim Lucas
General php-general@lists.php.net Subject: Re: [PHP] Array Date: Sat, 24 Oct 2009 11:50:14 -0300 On Sat, Oct 24, 2009 at 7:59 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Sat, 2009-10-24 at 06:57 -0400, Ron Piggott wrote: The following line gives me an error

Re: [PHP] Array references - how to unset() ?

2009-09-03 Thread hack988 hack988
Yes,thanks and I sorry for my poor english 2009/9/3 Robert Cummings rob...@interjinn.com: hack988 hack988 wrote: Reference vars in php would not be unset if it reference by another var,so you must keep original var had'nt being reference. You can't reference a reference in PHP. If you take

[PHP] Array references - how to unset() ?

2009-09-02 Thread Martin Zvarík
$ARR = array( 'a' = array('b' = 'blah') ); function set($key) { global $ARR; foreach ($key as $i = $k) { if ($i == 0) { $sourcevar = $ARR[$k]; } else { $sourcevar = $sourcevar[$k]; } } // unset($sourcevar); // will

Re: [PHP] Array references - how to unset() ?

2009-09-02 Thread Robert Cummings
Martin Zvarík wrote: $ARR = array( 'a' = array('b' = 'blah') ); function set($key) { global $ARR; foreach ($key as $i = $k) { if ($i == 0) { $sourcevar = $ARR[$k]; } else { $sourcevar = $sourcevar[$k]; } }

Re: [PHP] Array references - how to unset() ?

2009-09-02 Thread Martin Zvarík
Robert Cummings napsal(a): Martin Zvarík wrote: $ARR = array( 'a' = array('b' = 'blah') ); function set($key) { global $ARR; foreach ($key as $i = $k) { if ($i == 0) { $sourcevar = $ARR[$k]; } else { $sourcevar =

Re: [PHP] Array references - how to unset() ?

2009-09-02 Thread Robert Cummings
Martin Zvarík wrote: Robert Cummings napsal(a): Martin Zvarík wrote: $ARR = array( 'a' = array('b' = 'blah') ); function set($key) { global $ARR; foreach ($key as $i = $k) { if ($i == 0) { $sourcevar = $ARR[$k]; } else {

Re: [PHP] Array references - how to unset() ?

2009-09-02 Thread Martin Zvarík
AHA !!! OMG... how come I did not see that!? Instead this: $array = $array[$final]; unset($array); This: unset($array[$final]); 3 AM in the morning... that must be the reason! .) Thanks. This is possible. You're just not giving enough consideration to your exit strategy :) ?php

[PHP] array() returns something weird

2009-08-22 Thread Szczepan Hołyszewski
Hello! I am almost certain I am hitting some kind of bug. All of a sudden, array() stops returning an empty array and starts returning something weird. The weird thing behaves as NULL in most circumstances (e.g. gettype() says NULL), except: $foo=array(); // -- weird thing

Re: [PHP] array() returns something weird

2009-08-22 Thread Lars Torben Wilson
2009/8/22 Szczepan Hołyszewski webmas...@strefarytmu.pl: Hello! I am almost certain I am hitting some kind of bug. All of a sudden, array() stops returning an empty array and starts returning something weird. The weird thing behaves as NULL in most circumstances (e.g. gettype() says NULL),

Re: [PHP] array() returns something weird

2009-08-22 Thread Szczepan Hołyszewski
What it looks like to me is that something is causing $foo to be a string before the '$foo[] = bar;' line is encountered. What do you get if you put a gettype($foo); just before that line? $foo=null; $foo[]=bar; // -- $foo simply becomes an array NULL. That is the

Re: [PHP] array() returns something weird

2009-08-22 Thread Lars Torben Wilson
2009/8/22 Szczepan Hołyszewski webmas...@strefarytmu.pl: What it looks like to me is that something is causing $foo to be a string before the '$foo[] = bar;' line is encountered. What do you get if you put a gettype($foo); just before that line?        $foo=null;        $foo[]=bar;      //

Re: [PHP] array() returns something weird

2009-08-22 Thread Ralph Deffke
well, when I saw ur post I got immediately the thought I would bed it has to do with some stuff of $this or self. I did play arround a bit with class creation the last days and yes, with using self parent and $this I did put the HTTPPD in unstable and sometimes it died without beeing able to send

Re: [PHP] array() returns something weird

2009-08-22 Thread Szczepan Hołyszewski
Hm. . .it does look odd. Searching the bugs database at http://bugs.php.net does turn up one other report (at http://bugs.php.net/bug.php?id=47870 ) of array() returning NULL in certain hard-to-duplicate circumstances on FreeBSD, Yes, I found it even before posting here, but I wasn't sure

Re: [PHP] array() returns something weird

2009-08-22 Thread Lars Torben Wilson
2009/8/22 Szczepan Hołyszewski webmas...@strefarytmu.pl: Hm. . .it does look odd. Searching the bugs database at http://bugs.php.net does turn up one other report (at http://bugs.php.net/bug.php?id=47870 ) of array() returning NULL in certain hard-to-duplicate circumstances on FreeBSD, Yes,

[PHP] Array

2009-08-10 Thread Ron Piggott
How do I change this ELSEIF into an array? } elseif ( ( $page ) AND ( $page home_page ) AND ( $page verse_of_the_day_activate ) AND ( $page member_services ) AND ( $page member_services_login ) AND ( $page member_services_logoff ) AND ( $page resource_center ) AND ( $page network ) )

Re: [PHP] Array

2009-08-10 Thread Jonathan Tapicer
On Mon, Aug 10, 2009 at 9:28 AM, Ron Piggottron.pigg...@actsministries.org wrote: How do I change this ELSEIF into an array? } elseif ( ( $page ) AND ( $page home_page ) AND ( $page verse_of_the_day_activate ) AND ( $page member_services ) AND ( $page member_services_login ) AND (

Re: [PHP] Array

2009-08-10 Thread Robert Cummings
Ron Piggott wrote: How do I change this ELSEIF into an array? } elseif ( ( $page ) AND ( $page home_page ) AND ( $page verse_of_the_day_activate ) AND ( $page member_services ) AND ( $page member_services_login ) AND ( $page member_services_logoff ) AND ( $page resource_center ) AND (

Re: [PHP] Array

2009-08-10 Thread Jim Lucas
Ron Piggott wrote: How do I change this ELSEIF into an array? } elseif ( ( $page ) AND ( $page home_page ) AND ( $page verse_of_the_day_activate ) AND ( $page member_services ) AND ( $page member_services_login ) AND ( $page member_services_logoff ) AND ( $page resource_center )

[PHP] array manipulation

2009-04-16 Thread PJ
The more I get into arrays, the less I understand. I have a ridiculously simple task which excapes me completely. I need to ouput all fields in 1 column from 1 table in two phases sorted alphabetically. So, I have the query, I have the results. But since I need to split the list into 2 parts, I

Re: [PHP] array manipulation

2009-04-16 Thread PJ
Sorry, bout that. My brain wasn't working right. It was a lot simpler than I thought. Forget the foreach. I used a counter. :-[ PJ wrote: The more I get into arrays, the less I understand. I have a ridiculously simple task which excapes me completely. I need to ouput all fields in 1 column

Re: [PHP] array manipulation

2009-04-16 Thread German Geek
soln: YOU NEED A 2 WEEK HOLLIDAY at least! You need to learn to say no. Tim-Hinnerk Heuer http://www.ihostnz.com Samuel Goldwynhttp://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html - A wide screen just makes a bad film twice as bad. 2009/4/17 PJ af.gour...@videotron.ca The more I get

[PHP] Hello, I have a question about php array max number

2009-04-09 Thread PeterDu
Hello, I have an array including 2000 records in database, but when fetch all of them, why just get 1500 records? Does that depend on my computer? Peter __ Information from ESET NOD32 Antivirus, version of virus signature database 3997 (20090409) __ The message was

[PHP] Hello, I have a question about php array max number

2009-04-09 Thread PeterDu
Hello, I have an array including 2000 records in database, but when fetch all of them, why just get 1500 records? Does that depend on my computer? Peter __ Information from ESET NOD32 Antivirus, version of virus signature database 3997 (20090409) __ The message was

Re: [PHP] Hello, I have a question about php array max number

2009-04-09 Thread Bastien Koert
On Thu, Apr 9, 2009 at 2:36 PM, PeterDu pete...@telus.net wrote: Hello, I have an array including 2000 records in database, but when fetch all of them, why just get 1500 records? Does that depend on my computer? Peter __ Information from ESET NOD32 Antivirus, version of virus

[PHP] Re: Hello, I have a question about php array max number

2009-04-09 Thread Jonesy
On Thu, 9 Apr 2009 10:08:12 -0700, PeterDu wrote: Hello, I have an array including 2000 records in database, but when fetch all of them, why just get 1500 records? Does that depend on my computer? Well, at least you hi-jacked a thread that did not pertain to PHP and put it back On Topic!

[PHP] Array Brain Freeze

2009-03-19 Thread Dan Shirah
Hello all, I have the follwoing piece of code: //reference a stored procedure $procedure = Execute Procedure informix.arrest_char($part_id); //run the stored procedure $char_query = ifx_query($procedure, $connect_id); //get the result of the stored procedure $char_result =

[PHP] array/iteration issue!!

2008-11-27 Thread bruce
hi. i have the following test multidiminsional array. i'm trying to figure out how to iterate through the array, to produce something like foo, physics, sss foo, physics, sffgg foo, english, sss foo, english, sffgg can't quite seem to get it right!! thoughts/comments... etc... thanks

Re: [PHP] array/iteration issue!!

2008-11-27 Thread Robert Cummings
On Thu, 2008-11-27 at 17:31 -0800, bruce wrote: hi. i have the following test multidiminsional array. i'm trying to figure out how to iterate through the array, to produce something like foo, physics, sss foo, physics, sffgg foo, english, sss foo, english, sffgg can't quite seem to

RE: [PHP] array/iteration issue!!

2008-11-27 Thread bruce
iterate through this..?? thanks -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Thursday, November 27, 2008 6:18 PM To: bruce Cc: 'PHP General list' Subject: Re: [PHP] array/iteration issue!! On Thu, 2008-11-27 at 17:31 -0800, bruce wrote: hi. i have

RE: [PHP] array/iteration issue!!

2008-11-27 Thread Robert Cummings
On Thu, 2008-11-27 at 18:55 -0800, bruce wrote: hey robert.. ok.. so if i changed the array to have a dept1, and a dept2 $a=array(college= foo, dept1=array(dept= physics, class=array(class1=sss,class2=sffgg) ), dept2=array(dept= english,

RE: [PHP] array/iteration issue!!

2008-11-27 Thread bruce
( dept = english, class = array ( class1 = sss, class2 = sffgg ) ) ); -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Thursday, November 27, 2008 7:10 PM To: bruce Cc: 'PHP General list' Subject: RE: [PHP

RE: [PHP] array/iteration issue!!

2008-11-27 Thread Robert Cummings
On Thu, 2008-11-27 at 19:36 -0800, bruce wrote: hey robert!! thanks. and yeah, you're right, it's not the best.. so tell me, given that i'm ripping through this on the fly, and i can have the structure in any way i choose. this is just to simulate/populate some test tbls.. what's a better

Re: [PHP] array/iteration issue!!

2008-11-27 Thread Micah Gersten
Robert Cummings wrote: On Thu, 2008-11-27 at 19:36 -0800, bruce wrote: hey robert!! thanks. and yeah, you're right, it's not the best.. so tell me, given that i'm ripping through this on the fly, and i can have the structure in any way i choose. this is just to simulate/populate some

RE: [PHP] array/iteration issue!!

2008-11-27 Thread bruce
much props guys!!! thanks!! -Original Message- From: Micah Gersten [mailto:[EMAIL PROTECTED] Sent: Thursday, November 27, 2008 8:23 PM To: Robert Cummings Cc: bruce; 'PHP General list' Subject: Re: [PHP] array/iteration issue!! Robert Cummings wrote: On Thu, 2008-11-27 at 19:36 -0800

Re: [PHP] array/iteration issue!!

2008-11-27 Thread Robert Cummings
On Thu, 2008-11-27 at 22:22 -0600, Micah Gersten wrote: This is actually a much smaller data structure. $colleges = array ( 'Blah Blah University' = array ( 'physics' = array ( 'sss', 'sffgg',

RE: [PHP] array/iteration issue!!

2008-11-27 Thread bruce
Cummings [mailto:[EMAIL PROTECTED] Sent: Thursday, November 27, 2008 8:40 PM To: Micah Gersten Cc: bruce; 'PHP General list' Subject: Re: [PHP] array/iteration issue!! On Thu, 2008-11-27 at 22:22 -0600, Micah Gersten wrote: This is actually a much smaller data structure. $colleges = array

[PHP] Array of PDO objects

2008-06-06 Thread Miguel J. Jiménez
Hi, I want to know if I can set an array with PDO objects, thus: $foo = array(new PDO(...), new PDO(...)); $oSt = $foo[0]-prepare(...); and so on... I tried that aproach and PHP is always complaining about using prepare() in a non-object... ---

Re: [PHP] Array of PDO objects

2008-06-06 Thread Nathan Nobbe
2008/6/6 Miguel J. Jiménez [EMAIL PROTECTED]: Hi, I want to know if I can set an array with PDO objects, thus: $foo = array(new PDO(...), new PDO(...)); $oSt = $foo[0]-prepare(...); and so on... I tried that aproach and PHP is always complaining about using prepare() in a

RE: [PHP] array recursion from database rows

2008-05-25 Thread Wolf
] Sent: Saturday, May 24, 2008 2:25 PM To: php-general@lists.php.net Subject: [PHP] array recursion from database rows Hi. I have a database table I have created for navigation. The table fields are uid, parent_id, menu_name. Each entry is either a top level element with a parent_id of 0

[PHP] array recursion from database rows

2008-05-24 Thread Bob
Hi. I have a database table I have created for navigation. The table fields are uid, parent_id, menu_name. Each entry is either a top level element with a parent_id of 0 or a child which has a parent_id that relates to the parent uid. What I am trying to do is recurse through a set of rows

Re: [PHP] array recursion from database rows

2008-05-24 Thread Bastien Koert
On 5/24/08, Bob [EMAIL PROTECTED] wrote: Hi. I have a database table I have created for navigation. The table fields are uid, parent_id, menu_name. Each entry is either a top level element with a parent_id of 0 or a child which has a parent_id that relates to the parent uid. What I am

Re: [PHP] Array pointer to a function

2008-04-07 Thread Nathan Nobbe
On Tue, Apr 8, 2008 at 12:00 AM, hce [EMAIL PROTECTED] wrote: Hi, Is it possible for an array to point a function: Asignmanet $ArrayPointer = $this-MyFunction; Invoke: $ArraryPointer(); i would recommend you investigate variable functions 1.

Re: [PHP] Array pointer to a function

2008-04-07 Thread Robert Cummings
On Tue, 2008-04-08 at 14:00 +1000, hce wrote: Hi, Is it possible for an array to point a function: Asignmanet $ArrayPointer = $this-MyFunction; Invoke: $ArraryPointer(); No, you can't do what you've done above. What you can do is... ?php $ptr = array( 'obj' = $this,

[PHP] PHP: array with null shows different with print_r and var_dump

2008-04-02 Thread Sanjay Mantoor
Hello, I am new to PHP and PHP community. Following program outputs different values with print_r and var_dump. $array = array(null, NULL); print_r($array); prints values like below Array ( [0] = [1] = ) where as var_dump($array) prints values like below array(2) { [0]= NULL//

Re: [PHP] PHP: array with null shows different with print_r and var_dump

2008-04-02 Thread Casey
On Tue, Apr 1, 2008 at 11:49 PM, Sanjay Mantoor [EMAIL PROTECTED] wrote: Hello, I am new to PHP and PHP community. Following program outputs different values with print_r and var_dump. $array = array(null, NULL); print_r($array); prints values like below Array ( [0] =

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