Re: [PHP] Arrays

2013-02-26 Thread tamouse mailing lists
On Mon, Feb 25, 2013 at 9:51 PM, Karl DeSaulniers k...@designdrumm.com wrote: Never mind. I found a different function that reads out the children as well into the array. function xml_parse_into_assoc($data) { $p = xml_parser_create();

Re: [PHP] Arrays

2013-02-26 Thread Karl DeSaulniers
On Feb 26, 2013, at 10:35 PM, tamouse mailing lists wrote: On Mon, Feb 25, 2013 at 9:51 PM, Karl DeSaulniers k...@designdrumm.com wrote: Never mind. I found a different function that reads out the children as well into the array. function xml_parse_into_assoc($data) {

[PHP] Arrays

2013-02-25 Thread Karl DeSaulniers
Hi Guys/Gals, If I have an multidimensional array and it has items that have the same name in it, how do I get the values of each similar item? EG: specialservices = array( specialservice = array( serviceid = 1, servicename= signature required,

Re: [PHP] Arrays

2013-02-25 Thread Adam Richardson
On Mon, Feb 25, 2013 at 8:40 PM, Karl DeSaulniers k...@designdrumm.com wrote: Hi Guys/Gals, If I have an multidimensional array and it has items that have the same name in it, how do I get the values of each similar item? EG: specialservices = array( specialservice = array(

Re: [PHP] Arrays

2013-02-25 Thread Jim Lucas
On 02/25/2013 05:40 PM, Karl DeSaulniers wrote: Hi Guys/Gals, If I have an multidimensional array and it has items that have the same name in it, how do I get the values of each similar item? EG: specialservices = array( specialservice = array( serviceid = 1, servicename= signature required,

Re: [PHP] Arrays

2013-02-25 Thread Karl DeSaulniers
On Feb 25, 2013, at 7:48 PM, Adam Richardson wrote: On Mon, Feb 25, 2013 at 8:40 PM, Karl DeSaulniers k...@designdrumm.com wrote: Hi Guys/Gals, If I have an multidimensional array and it has items that have the same name in it, how do I get the values of each similar item? EG:

Re: [PHP] Arrays

2013-02-25 Thread Karl DeSaulniers
On Feb 25, 2013, at 7:50 PM, Jim Lucas wrote: On 02/25/2013 05:40 PM, Karl DeSaulniers wrote: Hi Guys/Gals, If I have an multidimensional array and it has items that have the same name in it, how do I get the values of each similar item? EG: specialservices = array( specialservice =

Re: [PHP] Arrays

2013-02-25 Thread Karl DeSaulniers
Never mind. I found a different function that reads out the children as well into the array. function xml_parse_into_assoc($data) { $p = xml_parser_create(); xml_parser_set_option($p,

Re: [PHP] Arrays: Comma at end?

2012-02-08 Thread Larry Garfield
On 2/7/12 1:50 PM, Micky Hulse wrote: Was there ever a time when having a comma at the end of the last array element was not acceptable in PHP? I just did a few quick tests: https://gist.github.com/1761490 ... and it looks like having that comma ain't no big deal. I can't believe that I

Re: [PHP] Arrays: Comma at end?

2012-02-08 Thread Robert Cummings
On 12-02-07 02:50 PM, Micky Hulse wrote: Was there ever a time when having a comma at the end of the last array element was not acceptable in PHP? I just did a few quick tests: https://gist.github.com/1761490 ... and it looks like having that comma ain't no big deal. I can't believe that I

Re: [PHP] Arrays: Comma at end?

2012-02-08 Thread Micky Hulse
On Wed, Feb 8, 2012 at 9:58 AM, Larry Garfield la...@garfieldtech.com wrote: Drupal's coding standards encourage the extra trailing comma on multi-line arrays, for all the readability and editability benefits that others have mentioned.  We have for years.  Cool stuff. :-) Yah, I love that

Re: [PHP] Arrays: Comma at end?

2012-02-08 Thread Micky Hulse
On Wed, Feb 8, 2012 at 10:08 AM, Robert Cummings rob...@interjinn.com wrote: JavaScript in Internet Crapsplorer spanks you on the bottom every time you have a trailing comma in a JS array. That may be where you picked up the aversion. On Wed, Feb 8, 2012 at 10:10 AM, Micky Hulse

Re: [PHP] Arrays: Comma at end?

2012-02-08 Thread Robert Cummings
On 12-02-08 01:12 PM, Micky Hulse wrote: On Wed, Feb 8, 2012 at 10:08 AM, Robert Cummingsrob...@interjinn.com wrote: JavaScript in Internet Crapsplorer spanks you on the bottom every time you have a trailing comma in a JS array. That may be where you picked up the aversion. On Wed, Feb 8,

[PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
Was there ever a time when having a comma at the end of the last array element was not acceptable in PHP? I just did a few quick tests: https://gist.github.com/1761490 ... and it looks like having that comma ain't no big deal. I can't believe that I always thought that having the trailing

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Ashley Sheridan
On Tue, 2012-02-07 at 11:50 -0800, Micky Hulse wrote: Was there ever a time when having a comma at the end of the last array element was not acceptable in PHP? I just did a few quick tests: https://gist.github.com/1761490 ... and it looks like having that comma ain't no big deal. I

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Paul M Foster
On Tue, Feb 07, 2012 at 11:50:45AM -0800, Micky Hulse wrote: Was there ever a time when having a comma at the end of the last array element was not acceptable in PHP? I just did a few quick tests: https://gist.github.com/1761490 ... and it looks like having that comma ain't no big

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
Hi Ashley! Thanks for your quick and informative reply, I really appreciate it. :) On Tue, Feb 7, 2012 at 12:10 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: It's easy to add and remove elements without making sure you have to check the trailing comma. It's also OK in Javascript to use

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Ashley Sheridan
On Tue, 2012-02-07 at 15:15 -0500, Paul M Foster wrote: On Tue, Feb 07, 2012 at 11:50:45AM -0800, Micky Hulse wrote: Was there ever a time when having a comma at the end of the last array element was not acceptable in PHP? I just did a few quick tests:

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
On Tue, Feb 7, 2012 at 12:15 PM, Paul M Foster pa...@quillandmouse.com wrote: I've always avoided trailing array commas, but only because I was under the impression that leaving one there would append a blank array member to the array, where it might be problematic. Yes? No? Yah, ditto! :D In

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
On Tue, Feb 7, 2012 at 12:19 PM, Micky Hulse rgmi...@gmail.com wrote: Yah, ditto! :D $s = 'foo,bar,'; print_r(explode(',', $s)); The output is: Array ( [0] = foo [1] = bar [2] = ) That's one instance where I know you have to be cautious about the trailing delimiter. I know, this

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Robert Williams
On 2/7/12 13:15, Paul M Foster pa...@quillandmouse.com wrote: I've always avoided trailing array commas, but only because I was under the impression that leaving one there would append a blank array member to the array, where it might be problematic. Yes? No? Nope. In fact, it's officially

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Ashley Sheridan
On Tue, 2012-02-07 at 12:26 -0800, Micky Hulse wrote: On Tue, Feb 7, 2012 at 12:19 PM, Micky Hulse rgmi...@gmail.com wrote: Yah, ditto! :D $s = 'foo,bar,'; print_r(explode(',', $s)); The output is: Array ( [0] = foo [1] = bar [2] = ) That's one instance where I

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
On Tue, Feb 7, 2012 at 12:32 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: That's because it's not an array you've got the trailing delimiter on, it's a string. Right. Sorry, bad example. it was just the one example I could think of where you could get an empty element at the end of

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Ghodmode
On Wed, Feb 8, 2012 at 4:10 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Tue, 2012-02-07 at 11:50 -0800, Micky Hulse wrote: Was there ever a time when having a comma at the end of the last array element was not acceptable in PHP? ... It's fine in PHP, and some coding practices

[PHP] Arrays passed to functions lose their indexing - how to maintain?

2010-07-09 Thread Marc Guay
Hi folks, I have an array that looks a little something like this: Array ( [6] = 43.712608, -79.360092 [7] = 43.674088, -79.388557 [8] = 43.674088, -79.388557 [9] = 43.704666, -79.397873 [10] = 43.674393, -79.372147 ) but after I pass it to a function, it loses it's indexing and becomes: Array

Re: [PHP] Arrays passed to functions lose their indexing - how to maintain?

2010-07-09 Thread Ashley Sheridan
On Fri, 2010-07-09 at 15:55 -0400, Marc Guay wrote: Hi folks, I have an array that looks a little something like this: Array ( [6] = 43.712608, -79.360092 [7] = 43.674088, -79.388557 [8] = 43.674088, -79.388557 [9] = 43.704666, -79.397873 [10] = 43.674393, -79.372147 ) but after I

Re: [PHP] Arrays passed to functions lose their indexing - how to maintain?

2010-07-09 Thread Marc Guay
My bad, I had some leftover code running array_values() on it before it got passed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Arrays Regexp - Help Requested

2010-01-01 Thread Allen McCabe
Happy New Year, here's my first question of the year (and it's only 15 hours into the year!). I am creating a small database management tool for my a website (my work IP blocks my access to PhpMyAdmin) and I don't want to install any additional software. I am working on adding rows and need to

Re: [PHP] Arrays Regexp - Help Requested

2010-01-01 Thread Mari Masuda
I think the problem is here: echo 'input type=' . $input_type . ' '; [...snip...] elseif ($input_type == 'textarea') { echo 'rows=7 cols=30 '; echo 'value='; if ($field['null'] == 'YES') // CAN BE NULL? { echo 'NULL'; } echo ' '; } because to

Re: [PHP] Re: Hidden costs of PHP arrays?

2009-01-30 Thread Kyle Terry
On Jan 29, 2009, at 6:07 PM, Eric Butera eric.but...@gmail.com wrote: On Thu, Jan 29, 2009 at 9:02 PM, Paul M Foster pa...@quillandmouse.com wrote: On Fri, Jan 30, 2009 at 11:10:16AM +1100, Clancy wrote: snip As a former assembly language programmer I have some idea of the vast amount of

RE: [PHP] Re: Hidden costs of PHP arrays?

2009-01-30 Thread Boyd, Todd M.
-Original Message- From: Paul M Foster [mailto:pa...@quillandmouse.com] Sent: Thursday, January 29, 2009 8:02 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: Hidden costs of PHP arrays? On Fri, Jan 30, 2009 at 11:10:16AM +1100, Clancy wrote: snip As a former assembly

[PHP] Re: Hidden costs of PHP arrays?

2009-01-29 Thread Clancy
On Wed, 28 Jan 2009 00:50:18 +, nrix...@gmail.com (Nathan Rixham) wrote: Clancy wrote: Also what the relative virtues of defining the same set of fields for every contact, as against either defining only the fields which actually hold values, as in the following examples? a:

[PHP] MicroSlow Software (was: Re: Hidden costs of PHP arrays?)

2009-01-29 Thread Micah Gersten
Clancy wrote: One could reasonably hope that the same could be said for every part of the programming chain, but it is one of the ironies of modern computing that computers get faster and faster, memory gets cheaper and cheaper, programming appears to get simpler and simpler, yet the

Re: [PHP] Re: Hidden costs of PHP arrays?

2009-01-29 Thread Paul M Foster
On Fri, Jan 30, 2009 at 11:10:16AM +1100, Clancy wrote: snip As a former assembly language programmer I have some idea of the vast amount of thumb twiddling which is going on behind-the-scenes when I make some apparently simple request like the one to get my phone number. Undoubtedly most

Re: [PHP] Re: Hidden costs of PHP arrays?

2009-01-29 Thread Eric Butera
On Thu, Jan 29, 2009 at 9:02 PM, Paul M Foster pa...@quillandmouse.com wrote: On Fri, Jan 30, 2009 at 11:10:16AM +1100, Clancy wrote: snip As a former assembly language programmer I have some idea of the vast amount of thumb twiddling which is going on behind-the-scenes when I make some

[PHP] Hidden costs of PHP arrays?

2009-01-27 Thread Clancy
PHP arrays permit extremely concise programming; for example if I have all my contacts in an array $contacts, I can write: $my_phone_no = $contacts['clancy']['phone']; However it is clear that there must be a lot going on behind the scenes to achieve this simple result, as it requires some

Re: [PHP] Hidden costs of PHP arrays?

2009-01-27 Thread Edmund Hertle
2009/1/28 Clancy clanc...@cybec.com.au PHP arrays permit extremely concise programming; for example if I have all my contacts in an array $contacts, I can write: $my_phone_no = $contacts['clancy']['phone']; However it is clear that there must be a lot going on behind the scenes to achieve

[PHP] Re: Hidden costs of PHP arrays?

2009-01-27 Thread Nathan Rixham
Clancy wrote: Also what the relative virtues of defining the same set of fields for every contact, as against either defining only the fields which actually hold values, as in the following examples? a: $contacts['clancy']['home_address'] = 'jkjkjk'; $contacts['clancy']['home_phone'] = 0123

Re: [PHP] Hidden costs of PHP arrays?

2009-01-27 Thread Robert Cummings
On Wed, 2009-01-28 at 10:38 +1100, Clancy wrote: PHP arrays permit extremely concise programming; for example if I have all my contacts in an array $contacts, I can write: $my_phone_no = $contacts['clancy']['phone']; However it is clear that there must be a lot going on behind the scenes

Re: [PHP] Hidden costs of PHP arrays?

2009-01-27 Thread Nathan Rixham
Robert Cummings wrote: On Wed, 2009-01-28 at 10:38 +1100, Clancy wrote: PHP arrays permit extremely concise programming; for example if I have all my contacts in an array $contacts, I can write: $my_phone_no = $contacts['clancy']['phone']; However it is clear that there must be a lot going

Re: [PHP] Arrays?

2007-01-08 Thread Sumeet
Nicholas Yim wrote: Hello William Stokes, 1 write a callback function: [php] function cmp_forth_value($left,$right){ return $left[4]$right?-1:($left[4]==$right[4]?0:1); return $left[4]$right[4]?-1:($left[4]==$right[4]?0:1); ^^^ add this }

Re: [PHP] Arrays?

2007-01-08 Thread Sumeet
Nicholas Yim wrote: Hello William Stokes, 1 write a callback function: [php] function cmp_forth_value($left,$right){ return $left[4]$right?-1:($left[4]==$right[4]?0:1); return $left[4]$right[4]?-1:($left[4]==$right[4]?0:1); ^^^ add this }

[PHP] Arrays?

2007-01-07 Thread William Stokes
Hello, How to print out the following array $test so that the print order is by the fourth[4] key? I need to print out all arrays in $test so that the data is ordered by the fourth key in ascending order. $test =Array ( [0] = Array ( [0] = 5 [1] = 2 [2] = sika [3] = sika.php [4] = 1

Re: [PHP] Arrays?

2007-01-07 Thread Nicholas Yim
Hello William Stokes, 1 write a callback function: [php] function cmp_forth_value($left,$right){ return $left[4]$right?-1:($left[4]==$right[4]?0:1); } [/php] 2 use the usort function usort($test,'cmp_forth_value'); Best regards, === At 2007-01-08, 14:46:33 you wrote:

[PHP] Arrays help

2007-01-05 Thread William Stokes
Hello, I'm making a menu script that uses mysql, php and javascript to build a on mouse over dropdown menu to a page. I ran into some problems and would need help to get this working. (This is just the top level of the menusystem) 1. Get the toplevel links from DB, create array and put values

Re: [PHP] Arrays help

2007-01-05 Thread Robert Cummings
On Fri, 2007-01-05 at 18:48 +0200, William Stokes wrote: Hello, I'm making a menu script that uses mysql, php and javascript to build a on mouse over dropdown menu to a page. I ran into some problems and would need help to get this working. (This is just the top level of the menusystem)

Re: [PHP] Parsing serialized PHP arrays in C

2006-10-23 Thread Richard Lynch
On Sat, October 21, 2006 6:25 pm, Kevin Wilcox wrote: ext/standard/var_unserializer.c, and I don't think what will port to a That's pretty much the code I would have pointed you to... Unless you happen to KNOW that all the data inside the arrays is ultimately scaler or something... I suppose

[PHP] Parsing serialized PHP arrays in C

2006-10-21 Thread Kevin Wilcox
I have a feeling this may be the wrong group to ask this question, but I thought that if it is, someone can point me in the right direction. I'm working on a application written in C that needs to parse and understand php arrays that have been serialized and stored in a MySQL table. I started

Re: [PHP] Parsing serialized PHP arrays in C

2006-10-21 Thread Rasmus Lerdorf
Kevin Wilcox wrote: I have a feeling this may be the wrong group to ask this question, but I thought that if it is, someone can point me in the right direction. I'm working on a application written in C that needs to parse and understand php arrays that have been serialized and stored

Re: [PHP] arrays

2006-07-10 Thread tedd
At 3:38 PM -0400 7/10/06, Dallas Cahker wrote: Banging my head against a wall with arrays, maybe someone can help me with the answer. I have a db query that returns results from 1-100 or more. I want to put the results into an array and pull them out elsewhere. I want them to be pulled out in an

[PHP] arrays

2006-07-10 Thread Dallas Cahker
Banging my head against a wall with arrays, maybe someone can help me with the answer. I have a db query that returns results from 1-100 or more. I want to put the results into an array and pull them out elsewhere. I want them to be pulled out in an orderly and expected fashion. part of

Re: [PHP] arrays

2006-07-10 Thread Stut
Dallas Cahker wrote: Banging my head against a wall with arrays, maybe someone can help me with the answer. I have a db query that returns results from 1-100 or more. I want to put the results into an array and pull them out elsewhere. I want them to be pulled out in an orderly and expected

Re: [PHP] arrays

2006-07-10 Thread Brad Bonkoski
When loading the array you will only ever get the last record returned... so count($oarray) will always be 1? Perhaps something like this: Function $sql = ...; $ret = array(); while($row = mysql_feth_array($reault)) { array_push($ret, $row); } return $ret; then... $data = function(); $c =

Re: [PHP] arrays

2006-07-10 Thread Dallas Cahker
Both work great. Thanks On 7/10/06, Brad Bonkoski [EMAIL PROTECTED] wrote: When loading the array you will only ever get the last record returned... so count($oarray) will always be 1? Perhaps something like this: Function $sql = ...; $ret = array(); while($row =

[PHP] arrays

2006-06-09 Thread Jesús Alain Rodríguez Santos
if I have two arrays, example: $a = array (one, two, three, four, two); $b = array (seven, one, three, six, five); How can I get in another variable a new array with the same elements into $a and $b. -- Este mensaje ha sido analizado por MailScanner en busca de virus y otros contenidos

RE: [PHP] arrays

2006-06-09 Thread Jay Blanchard
[snip] if I have two arrays, example: $a = array (one, two, three, four, two); $b = array (seven, one, three, six, five); How can I get in another variable a new array with the same elements into $a and $b. [/snip] http://www.php.net/array_merge -- PHP General Mailing List

Re: [PHP] arrays

2006-06-09 Thread Dave Goodchild
Hola Jesus. Hablo un pocitio espanol, pero en ingles no estoy seguro que quieres decir. Si te ayudara, envia el mensaje otra vez en espanol y tratare comprender. On 09/06/06, Jesús Alain Rodríguez Santos [EMAIL PROTECTED] wrote: if I have two arrays, example: $a = array (one, two, three,

Re: [PHP] arrays

2006-06-09 Thread Rabin Vincent
On 6/9/06, Jesús Alain Rodríguez Santos [EMAIL PROTECTED] wrote: if I have two arrays, example: $a = array (one, two, three, four, two); $b = array (seven, one, three, six, five); How can I get in another variable a new array with the same elements into $a and $b. php.net/array_intersect

Re: [PHP] arrays

2006-06-09 Thread Mariano Guadagnini
Jess Alain Rodrguez Santos wrote: if I have two arrays, example: $a = array ("one", "two", "three", "four", "two"); $b = array ("seven", "one", "three", "six", "five"); How can I get in another variable a new array with the same elements into $a and $b. $new_array =

[PHP] Question for PHP Arrays

2006-04-28 Thread Saul Rennison
Hi, I'm making a PHP Installer that is customizable by using plugins, I haven't used PHP for a while and which I have forgotten some things about PHP *eek*.. Anyway, I want to know how to add things to an array. Like this: $foobar = array() $foobar['rar']['miaw'] Would that output come out

Re: [PHP] Question for PHP Arrays

2006-04-28 Thread Richard Davey
On 27 Apr 2006, at 20:51, Saul Rennison wrote: Anyway, I want to know how to add things to an array. Like this: $foobar = array() $foobar['rar']['miaw'] Would that output come out (for the array) as: array( 'rar' = 'miaw' ) No, it would create a multi-dimensional array that contains

Re: [PHP] Question for PHP Arrays

2006-04-28 Thread Jochem Maas
Saul Rennison wrote: Hi, I'm making a PHP Installer that is customizable by using plugins, I haven't used PHP for a while and which I have forgotten some things about PHP *eek*.. $hiddenKnowledge = unforgetPHP(); Anyway, I want to know how to add things to an array. Like this: $foobar =

[PHP] Arrays

2006-02-04 Thread Philip W.
Sorry if this question seems stupid - I've only had 3 days of PHP experience. When using the following string format, I get an error from PHP. $text['text'] = String Text ; Can someone help me? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Arrays

2006-02-04 Thread Paul Novitski
At 11:12 AM 2/4/2006, Philip W. wrote: When using the following string format, I get an error from PHP. $text['text'] = String Text ; Hi Philip, If that's literally a line from your script, my guess is that text is a reserved word and can't be used as a variable name. Try $sText or

Re: [PHP] Arrays

2006-02-04 Thread Hugh Danaher
, February 04, 2006 11:12 AM Subject: [PHP] Arrays Sorry if this question seems stupid - I've only had 3 days of PHP experience. When using the following string format, I get an error from PHP. $text['text'] = String Text ; Can someone help me? -- PHP General Mailing List (http://www.php.net

[PHP] Arrays

2005-12-06 Thread Ben Miller
If I have an array, such as $Var[0] = Dog; $Var[1] = Cat; $Var[2] = Horse; Is there a way to quickly check to see if $Var contains Lion without walking through each value? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Arrays

2005-12-06 Thread Jay Blanchard
[snip] Is there a way to quickly check to see if $Var contains Lion without walking through each value? [/snip] http://us3.php.net/in_array -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Arrays

2005-12-06 Thread Richard Davey
On 6 Dec 2005, at 17:33, Ben Miller wrote: If I have an array, such as $Var[0] = Dog; $Var[1] = Cat; $Var[2] = Horse; Is there a way to quickly check to see if $Var contains Lion without walking through each value? Look in the manual at the function in_array() Cheers, Rich --

Re: [PHP] Arrays

2005-12-06 Thread tg-php
This what you want? http://us3.php.net/manual/en/function.array-search.php -TG = = = Original message = = = If I have an array, such as $Var[0] = Dog; $Var[1] = Cat; $Var[2] = Horse; Is there a way to quickly check to see if $Var contains Lion without walking through each value?

Re: [PHP] arrays question

2005-11-12 Thread Brian V Bonini
On Fri, 2005-11-11 at 15:25, cybermalandro cybermalandro wrote: I have this that looks like this array(3) { [0]= array(2) { [0]= string(1) 1 [1]= string(1) 2 } [1]= array(2) { [0]= string(3) 492 [1]= string(3) 211 } [2]= array(2)

[PHP] arrays question

2005-11-11 Thread cybermalandro cybermalandro
I have this that looks like this array(3) { [0]= array(2) { [0]= string(1) 1 [1]= string(1) 2 } [1]= array(2) { [0]= string(3) 492 [1]= string(3) 211 } [2]= array(2) { [0]= string(2) 11 [1]= string(2) 20 } } I want to loop through

Re: [PHP] arrays question

2005-11-11 Thread Brent Baisley
Here's a few loops that should work. You can actually just use the first loop to concatenate text string instead create array items, but I wasn't sure what type of processing you wanted to do with the result. //Convert Array from 3 rows by 2 cols - 2 rows by 3 cols for($i=0;

[PHP] Arrays

2005-07-12 Thread virtualsoftware
Hi, How can i destroy an array? I mean i have a loop and for each new value in the loop i want to destroy the array. Something like that: while($row = mysql_fetch_array($result)) { $product[] = $product_id; // some code here } I've tried this but doesn't

Re: [PHP] Arrays

2005-07-12 Thread olivier
Hello, You may try unset($product) in your loop if you want to delete this var. Your code $product=array(); must work too... Another way, must be to use something like this $product[id]=$product_id; But i dont think it's your real goal?! Could you give some more information about that? Olivier

Re: [PHP] Arrays

2005-07-12 Thread Justin Gruenberg
On 12/07/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, How can i destroy an array? I mean i have a loop and for each new value in the loop i want to destroy the array. Something like that: while($row = mysql_fetch_array($result)) { $product[] = $product_id;

RE: [PHP] Arrays

2005-07-12 Thread yanghshiqi
. Best regards, Shiqi Yang -Original Message- From: Justin Gruenberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 12, 2005 7:43 PM To: [EMAIL PROTECTED]; php-general@lists.php.net Subject: Re: [PHP] Arrays On 12/07/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, How can i

[PHP] Arrays not recognized in Simple XML Objects (using print_r)

2005-03-23 Thread Yashesh Bhatia
hi! i'm trying to use the simple_xml functions to get an arrray of data from a sample xml file. here's my sample_data.xml ?xml version=1.0 encoding=ISO-8859-1? sample_data first_names

Re: [PHP] Arrays

2004-12-29 Thread Brent Baisley
You can absolutely use arrays as form field names. They allow great flexibility. Although you wouldn't use quotes for the array keys. So your form field name would be something like: att[keyname] While in PHP, the same array would look like: $att['keyname'] Your array id's are consider keys

[PHP] Arrays

2004-12-28 Thread GH
Would it be possible in a form fields name to make it an array? This way it would be i.e. att[$part_id] Now is there a way to iterate through the array when I submit the form to process it, being that the ID numbers are not going to be sequential and that there will be some numbers not

Re: [PHP] PHP arrays and javascript

2004-11-30 Thread Nick Peters
Hodicska Gergely wrote: trigger_error('Hoppa, egy új típus a PHP-ben? '.__CLASS__.'::'.__FUNCTION__.'()!', E_USER_WARNING); on that line, what is the error you are trying to catch? I can't read what ever language that is ;-) thanks. -Nick Peters -- PHP General

Re: [PHP] PHP arrays and javascript

2004-11-30 Thread Nick Peters
Hodicska Gergely wrote: Hi! Would this work the same for multidimensional arrays? Encoding was a special feature needed by me, maybe you don't need it. Usage: myArray = array(...); echo 'script'.arrayToJsArray($myArray, 'myArray').'/script'; Felho --- 8 --- arrayToJsArray.php ---

Re: [PHP] PHP arrays and javascript

2004-11-29 Thread Nick Peters
Marek Kilimajer wrote: Nick Peters wrote: Hey, i know this probally a simple question, but it has been stumping me for quite some time now. How do i pass a php array to a javascript? i tryed: script language=javascript var myarray = new Array(?PHP echo $myarray; ?); /script but it

Re: [PHP] PHP arrays and javascript

2004-11-29 Thread Marek Kilimajer
Nick Peters wrote: Marek Kilimajer wrote: Nick Peters wrote: Hey, i know this probally a simple question, but it has been stumping me for quite some time now. How do i pass a php array to a javascript? i tryed: script language=javascript var myarray = new Array(?PHP echo $myarray; ?); /script but

Re: [PHP] PHP arrays and javascript

2004-11-29 Thread Hodicska Gergely
Hi! Would this work the same for multidimensional arrays? Encoding was a special feature needed by me, maybe you don't need it. Usage: myArray = array(...); echo 'script'.arrayToJsArray($myArray, 'myArray').'/script'; Felho --- 8 --- arrayToJsArray.php --- 8 --- ? function

[PHP] PHP arrays and javascript

2004-11-26 Thread Nick Peters
Hey, i know this probally a simple question, but it has been stumping me for quite some time now. How do i pass a php array to a javascript? i tryed: script language=javascript var myarray = new Array(?PHP echo $myarray; ?); /script but it didn't work. Anybody got any ideas? thanks in advance.

RE: [PHP] PHP arrays and javascript

2004-11-26 Thread Pablo Gosse
snip i know this probally a simple question, but it has been stumping me for quite some time now. How do i pass a php array to a javascript? i tryed: script language=javascript var myarray = new Array(?PHP echo $myarray; ?); /script but it didn't work. Anybody got any ideas? /snip You need to

Re: [PHP] PHP arrays and javascript

2004-11-26 Thread Marek Kilimajer
Nick Peters wrote: Hey, i know this probally a simple question, but it has been stumping me for quite some time now. How do i pass a php array to a javascript? i tryed: script language=javascript var myarray = new Array(?PHP echo $myarray; ?); /script but it didn't work. Anybody got any ideas?

Re: [PHP] Arrays

2004-11-11 Thread James E Hicks III
Ben Miller wrote: edit I hope this is not a stupid question, but I am learning how to work with Arrays, and am having trouble figuring out how to move array values [the whole array and all of it's values] from page to page and/or store in a db. ? echo (htmlheadtitleArray

Re: [PHP] Arrays

2004-11-09 Thread Klaus Reimer
Zareef Ahmed wrote: But you need to do serialize and unserialize in case of array or object. Do :: $val_ar=array(one,two,three); $_SESSION['val_ar_store']=serialize($val_ar); Serialization is done automatically. You don't need to do it yourself. You can even store simple value-objects in the

[PHP] Arrays

2004-11-08 Thread Ben
I hope this is not a stupid question, but I am learning how to work with Arrays, and am having trouble figuring out how to move array values from page to page and/or store in a db. Once again, I am new to arrays (and fairly new to PHP for that matter), so please don't get too technical in

RE: [PHP] Arrays

2004-11-08 Thread Ben Miller
edit I hope this is not a stupid question, but I am learning how to work with Arrays, and am having trouble figuring out how to move array values [the whole array and all of it's values] from page to page and/or store in a db. Once again, I am new to arrays (and fairly new to PHP for that

Re: [PHP] Arrays

2004-11-08 Thread Greg Donald
On Mon, 8 Nov 2004 16:01:16 -0700, Ben [EMAIL PROTECTED] wrote: I hope this is not a stupid question, but I am learning how to work with Arrays, and am having trouble figuring out how to move array values from page to page and/or store in a db. Once again, I am new to arrays (and fairly new

RE: [PHP] Arrays

2004-11-08 Thread Zareef Ahmed
, 2004 4:31 AM To: [EMAIL PROTECTED] Subject: [PHP] Arrays I hope this is not a stupid question, but I am learning how to work with Arrays, and am having trouble figuring out how to move array values from page to page and/or store in a db. Once again, I am new to arrays (and fairly new to PHP

Re: [PHP] Arrays

2004-11-08 Thread Ligaya Turmelle
There are a couple of ways to pass arrays (and their values) between pages. I personally would put the array into a session variable ($_SESSION - see reference) and access the various parts as needed. Another option is sending the whole array or it's parts as hidden fields in a form (access

RE: [PHP] Arrays

2004-11-08 Thread Ben Miller
Message- From: Ligaya Turmelle [mailto:[EMAIL PROTECTED] Sent: Monday, November 08, 2004 10:03 PM To: Ben Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Arrays There are a couple of ways to pass arrays (and their values) between pages. I personally would put the array into a session variable

[PHP] arrays() current() next() who to use

2004-08-19 Thread Vern
I'm setting up an array based on recordset that does a loop as follows: do { //SET ARRAYS $z['username'][$k] = $row_rsUSERIDID['uname']; $z['distance'][$k++] = $totaldist; } while ($row_rsUSERIDID = mysql_fetch_assoc($rsUSERIDID)); //SET NEW ARRAY $z['user'] =

Re: [PHP] arrays() current() next() who to use

2004-08-19 Thread John Holmes
From: Vern [EMAIL PROTECTED] How can I now get this output displyed in groups of 10 so that I can display them 10 at a time on a page then click a next button to dispaly they next 10 and so forth? Can't you do all that sorting in your query so you can just retrieve 10 rows at a time

Re: [PHP] arrays() current() next() who to use

2004-08-19 Thread Vern
Problem with that is it sorts according the results of the recordset range. For instance: It will show the user 1 trhough 10 sorted by miles then 20 - 30 sorted by miles, however, in 1 through 10 could have a range of 0 to 1000 miles and the next set will have 5 to 200 miles. What I need is to

Re: [PHP] arrays() current() next() who to use

2004-08-19 Thread Torsten Roehr
Vern [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Problem with that is it sorts according the results of the recordset range. For instance: It will show the user 1 trhough 10 sorted by miles then 20 - 30 sorted by miles, however, in 1 through 10 could have a range of 0 to 1000

Re: [PHP] arrays() current() next() who to use

2004-08-19 Thread Vern
The miles are being caluculated during the loop that is created using the recordset not in the database. First I create a do..while loop to get the miles do { $k = 0; //SET FIRST ARRAY OF ONLINE USERS AND CALCULATE MILES do { //GEOZIP $zip2 = $row_rsUSERIDID['zip'];

  1   2   3   >