Hi,
I am having big problems with merging two arrays. I just can't seem to get
my head around it.
I have two arrays which I wish to merge, but I want to EXCLUDE duplicate
values.
Any suggestions, as my numerous attempts have proved unsuccessful.
BTW I'm using PHP4.
Many thanks
Alexis
--
PH
What is the best way to delete an element from an array?
I tried using unset(), and it didn't work.
Thanks in advance.
Tom Malone
Web Designer
HurstLinks Web Developmenthttp://www.hurstlinks.com/
Norfolk, VA 23510(757)623-9688 FAX 623-0433
PHP/MySQL - Ruby/Perl - HTML/Javascri
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 06, 2001 3:20 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Array problem
>
>
> I am having big problems with merging two arrays. I just
> can't seem to
This would work ...
--Joe
On Fri, Apr 06, 2001 at 09:19:52AM +0100, Alexis Antonakis wrote:
> Hi,
>
> I am having big problems with merging two arrays. I just can't seem to get
> my head around it.
>
> I have two arrays which I wish to merge, but I want to EXCLUDE duplicate
> values.
>
>
> What is the best way to delete an element from an array?
> I tried using unset(), and it didn't work.
unset works with arrary elements, but it must be a global variable and not passed in.
Try the code below to see the results.
in deleteGlobal()-Spot\n";
unset ($animals["Spot"]);
I'm trying to edit the specific item for each row found in the snippet
below. Each item gets a row in a table and I want to pass the item Id (s_id
below) to $item. It seems however that the array *item * is not
incrementing. For all rows I get the value of the first row.
Any ideas of what wron
Ok, here's the print_r() output of my 2 arrays. The first really just has an
extra dimension. How can I get the format of the first one looking like the
bottom one (just an array of key => value pairs)?
Thanks!
Array ( [0] => Array ( [trade_date] => Trade Date )
[1] => Array ( [settle_
foreach($oldArray as $a)) {
list($key, $value) = each($a);
$newArray[$key] = $value;
}
> -Original Message-
> From: Michael Champagne [mailto:[EMAIL PROTECTED]]
> Sent: 12 iulie 2001 17:37
> To: PHP General Mailing List
> Subject: [PHP] Array problem in P
On Thursday 12 July 2001 16:37, Michael Champagne wrote:
> Ok, here's the print_r() output of my 2 arrays. The first really just
> has an extra dimension. How can I get the format of the first one
> looking like the bottom one (just an array of key => value pairs)?
>
> Thanks!
>
> Array ( [0] =>
9 matches
Mail list logo