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
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
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
] = '';
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
'] = '';
$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
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
-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
] = '';
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
,
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
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
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
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
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
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
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]);
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])) {
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
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
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
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
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
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);
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
[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
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:
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
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
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);
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 =
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
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)
-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
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
)
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:
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
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
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
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
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
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
(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
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++];
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)
{
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
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
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
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.
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
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 =
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:
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
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
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
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
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
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
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
$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
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];
}
}
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 =
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 {
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
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
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),
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
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; //
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
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
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,
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 ) )
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 (
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 (
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 )
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
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
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
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
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
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
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!
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 =
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
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
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
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,
(
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
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
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
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
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',
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
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...
---
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
]
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
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
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
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.
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,
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//
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] =
101 - 200 of 1246 matches
Mail list logo