[PHP] convert associative array to ordinary array

2008-03-28 Thread It Maq
Hi, i have an associative array and i want to use it as an ordinary array, is that possible? what i mean is instead of $arr['fruit'] i want to call it by its position in the array $arr[3] thanks

Re: [PHP] convert associative array to ordinary array

2008-03-28 Thread Daniel Brown
On Fri, Mar 28, 2008 at 2:27 PM, It Maq [EMAIL PROTECTED] wrote: Hi, i have an associative array and i want to use it as an ordinary array, is that possible? what i mean is instead of $arr['fruit'] i want to call it by its position in the array $arr[3] Did you try? -- /Daniel

Re: [PHP] convert associative array to ordinary array

2008-03-28 Thread M. Sokolewicz
Daniel Brown wrote: On Fri, Mar 28, 2008 at 2:27 PM, It Maq [EMAIL PROTECTED] wrote: Hi, i have an associative array and i want to use it as an ordinary array, is that possible? what i mean is instead of $arr['fruit'] i want to call it by its position in the array $arr[3] Did you

Re: [PHP] convert associative array to ordinary array

2008-03-28 Thread Casey
On Fri, Mar 28, 2008 at 10:33 AM, Daniel Brown [EMAIL PROTECTED] wrote: On Fri, Mar 28, 2008 at 2:27 PM, It Maq [EMAIL PROTECTED] wrote: Hi, i have an associative array and i want to use it as an ordinary array, is that possible? what i mean is instead of $arr['fruit'] i want

Re: [PHP] convert associative array to ordinary array

2008-03-28 Thread It Maq
thank you, it works! --- Casey [EMAIL PROTECTED] wrote: On Fri, Mar 28, 2008 at 10:33 AM, Daniel Brown [EMAIL PROTECTED] wrote: On Fri, Mar 28, 2008 at 2:27 PM, It Maq [EMAIL PROTECTED] wrote: Hi, i have an associative array and i want to use it as an ordinary array, is

[PHP] [SOLUTION] Re: [PHP] Convert an array in an object instance

2004-10-27 Thread Francisco M. Marzoa Alonso
Ok, I've write a function that emulates the Perl's bless one. It works pretty well. The idea comes to me when Rob suggest to parse the serialized data. I think this is better -or at least faster- than parsing all serialized data to modify object values: Just convert the object to an array,

Re: [PHP] [SOLUTION] Re: [PHP] Convert an array in an object instance

2004-10-27 Thread Francisco M. Marzoa Alonso
Erm... I've seen there're some aspects to perform... it fails because the name of the members is changed during conversion to the array. It puts the class name using '\0' (0 is a zero, not a caps 'o') character as separator before member name in private and an '*' in protected. It's not an

[PHP] Convert an array in an object instance

2004-10-25 Thread Francisco M. Marzoa Alonso
Hi, Is it possible to convert an array in an object instance? I can convert an object in an array as follows: $Test = new MyClass (); $TestArray = (array) $Test; Then I've an array with all members of the object $Test, but it seems that I cannot simply do: $TestObject = (MyClass) $TestArray; To

[PHP] Convert An Array

2002-02-24 Thread jtjohnston
http://ccl.flsh.usherb.ca/db/authors_under_study.php or $names = array (john, mary, bill, mary, bill, mary, bill, john, bill, john); 1) How do I count the elements of $names to produce: bill 4 john 3 mary 3 2) How do I store the counted elements into a new array? How do I create this:

Re: [PHP] Convert An Array

2002-02-24 Thread Edward van Bilderbeek - Bean IT
http://www.php.net/manual/en/function.array-count-values.php - Original Message - From: jtjohnston [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, February 24, 2002 10:49 PM Subject: [PHP] Convert An Array http://ccl.flsh.usherb.ca/db/authors_under_study.php or $names