NYCPHP Meetup

NYPHP.org

[nycphp-talk] Change key values in array

Rafi Sheikh Rafi.Sheikh at Ingenix.com
Thu May 20 13:31:02 EDT 2004


Hi folks.  Is it possible to change the key value type in an array?  I have
an array that has string key values, for my purposes I need it to have int
index

NOW LOOKS LIKE:
array(6) { ["04-01"]=> int(0) ["04-02"]=> string(2) "32" ["04-03"]=> int(0)
["04-04"]=> int(0) ["04-05"]=> int(0) ["04-06"]=> int(0) }

I NEED IT TO LOOK LIKE:
array(6) { [0]=> int(0) [1]=> string(2) "32" [2]=> int(0) [3]=> int(0) [4]=>
int(0) [5]=> int(0) }

REASON:
I am getting date value from a DB, and than doing an array_merge with
another template to ensure that any missing month for a category get a zero
in the correct sequence.  Problem is that, the resulting array needs to have
int index for the graphing utility to work.

TIA


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.



More information about the talk mailing list