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) {

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,

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

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

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] 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 }

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:

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] 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

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 =

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 =

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
Philip, You'll often get an error call on a line when there is a problem on the previous line. Say, you forgot to end a line with a semicolon, then it will error the next line. Hugh - Original Message - From: Philip W. [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Saturday,

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)

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;

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

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

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

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
Hi Ben, Welcome to the wonderful world of PHP. Working with array in PHP is very easy. A large number of functions are there. Please visit the manual http://www.phpcertification.com/manual.php/ref.array.html You can move values ( including Arrays) from page to page in session variables. But

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

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'];

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

2004-08-19 Thread Curt Zirzow
* Thus wrote 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)); ... How can I now

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

2004-08-19 Thread Vern
Well, this is the hard way to do things, and very inefficient but: foreach(array_slice($z['distance'], $start, 10) { //... } If you think there's a better way of doing it I would like to hear it. However this is resulting in an Parse error on the foreach line:

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

2004-08-19 Thread Michal Migurski
If you think there's a better way of doing it I would like to hear it. However this is resulting in an Parse error on the foreach line: foreach(array_slice($z['distance'], $start, 10)) { $newuser = $z['user'][$k]; echo $newuser . - . $v . br; } foreach needs an as, probably

RE: [PHP] arrays, loops, vars and props

2004-03-10 Thread Chris W. Parker
Jason Davidson mailto:[EMAIL PROTECTED] on Wednesday, March 10, 2004 12:25 AM said: would the following example be faster or slower had i simply done $this-myArray[$i] = $i; class MyClass { var $myArray = array(); function MyClass() { $myTempArray = array();

Re: [PHP] arrays, loops, vars and props

2004-03-10 Thread Luis Mirabal
i would do it this way function MyClass() { $this-myArray = range(0, 99); } luis. Chris W. Parker [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Jason Davidson mailto:[EMAIL PROTECTED] on Wednesday, March 10, 2004 12:25 AM said: would the following example be faster

RE: [PHP] arrays, loops, vars and props

2004-03-10 Thread Michal Migurski
here's how i would do it (coding styles aside): function MyClass() { $limit = 100; $i = -1; while(++$i $limit) { $this-myArray[] = $i; } } Don't forget poor old range: $this-myArray = range(0, 99);

RE: [PHP] arrays, loops, vars and props

2004-03-10 Thread Chris W. Parker
Luis Mirabal mailto:[EMAIL PROTECTED] on Wednesday, March 10, 2004 12:30 PM said: i would do it this way function MyClass() { $this-myArray = range(0, 99); } guys (luis), guys (mike), let's not try to one-up each other... ... ... but i would take it a step further. :P function

RE: [PHP] arrays, loops, vars and props

2004-03-10 Thread Jason Davidson
Im fully aware of diffrent ways of doing it, my question is, in the 2 ways i mentioned, which is more efficient. Ill take the question to the internals list. Thanks for your responses. Jason Chris W. Parker [EMAIL PROTECTED] wrote: Luis Mirabal mailto:[EMAIL PROTECTED] on Wednesday,

RE: [PHP] arrays and sessions

2004-02-27 Thread Chris W. Parker
Kermit Short mailto:[EMAIL PROTECTED] on Friday, February 27, 2004 1:47 PM said: A second form will contain an action that sends the sql code for creating the table to the database server, and viola, I've got myself a new table. i prefer the violin, but viola's are cool too. ;) If

Re: [PHP] arrays and sessions

2004-02-27 Thread Kermit Short
I've got some code and it simply isn't working. I thought it might be because each time the form submits data, the array I'm storing information in is being re-initialized. If this is the case, I don't have the multidimensional array I'm trying to get, but just a vector array with the most

RE: [PHP] arrays and sessions

2004-02-27 Thread Chris W. Parker
Kermit Short mailto:[EMAIL PROTECTED] on Friday, February 27, 2004 2:10 PM said: I've got some code and it simply isn't working. I thought it might be because each time the form submits data, the array I'm storing information in is being re-initialized. If this is the case, I don't have

Re: [PHP] arrays and sessions

2004-02-27 Thread Justin Patrin
First of all, make sure you're doing session_start() before reading/writing any session data and before you do any output. Second, You likely need to just do something like this: session_start(); if(post data) { $_SESSION['formArray'][] = $_POST; } This will save each POST array as-is in the

Re: [PHP] Arrays and performance

2003-11-18 Thread Raditha Dissanayake
Hi, I belive PHP should be able to handle it but it's a bad idea. The reason being your app will not scale. Because if you script consumes 2mb of memory on average, 100 users accesing it at the same time will be 200Mb. Of course if you expect only a small number of users it does not matter.

RE: [PHP] Arrays and performance

2003-11-18 Thread Pablo Gosse
Raditha Dissanayake wrote: [snip]The biggest XML job i have handled with PHP is parsing the ODP RDF dump which is around 700MB. Obviously arrays are out of the question in such a scenario, even though only one user will be accessing the script At a given moment. the ODP dump has a couple of

Re: [PHP] Arrays and performance

2003-11-18 Thread Raditha Dissanayake
hi, In fact i had to handle the ODP dump on two occaisions the first time the results went into a mysql db, the second time it went into a series of files. On both occaisions i used SAX parsers. DOM would just roll over and die with this much of data. I placed code in the end element handler

Re: [PHP] Arrays and performance

2003-11-18 Thread Kim Steinhaug
Thanks for your reply! Im going to use this for a backup system for our webstore system, where some of our customers have *alot* of products. Given the structure of the database with categories and images 5000 unique products quickly gives 3x = 15000 arrays. But again, how often would the client

RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Angelo Zanetti mailto:[EMAIL PROTECTED] on Tuesday, September 30, 2003 5:43 AM said: hi I have a table with rows and each row contains a checkbox ( array) and a record. TD of the checkbox: echo(td width=15 bgcolor=#9FD9FFinput type=checkbox name=chkR[] value=. $chkSessionF[$i] ./td);

Re: [PHP] arrays and php

2003-09-30 Thread Jason Wong
On Wednesday 01 October 2003 00:10, Chris W. Parker wrote: [snip] If you're not sure what a value is use print_r() to determine it. echo pre; print_r($chk); echo /pre; Quick side note on the above code: You cannot write it like: echo pre.print_r($chk)./pre; It will not work. You

RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Jason Wong mailto:[EMAIL PROTECTED] on Tuesday, September 30, 2003 11:06 AM said: echo pre.print_r($chk)./pre; It will not work. You can do this though: echo pre, print_r($chk), /pre; Well heck, that makes things easier! What's the difference between using , or . for

Re: [PHP] arrays and php

2003-09-30 Thread Jason Wong
On Wednesday 01 October 2003 02:14, Chris W. Parker wrote: Jason Wong mailto:[EMAIL PROTECTED] on Tuesday, September 30, 2003 11:06 AM said: echo pre.print_r($chk)./pre; It will not work. Actually, the above *does* work! -- Jason Wong - Gremlins Associates - www.gremlins.biz Open

Re: [PHP] arrays and php

2003-09-30 Thread CPT John W. Holmes
From: Chris W. Parker [EMAIL PROTECTED] echo pre.print_r($chk)./pre; It will not work. You can do this though: echo pre, print_r($chk), /pre; Well heck, that makes things easier! What's the difference between using , or . for concatenation? (I thought they were the same.) Using a

Re: [PHP] arrays and php

2003-09-30 Thread CPT John W. Holmes
From: Jason Wong [EMAIL PROTECTED] On Wednesday 01 October 2003 02:14, Chris W. Parker wrote: Jason Wong mailto:[EMAIL PROTECTED] on Tuesday, September 30, 2003 11:06 AM said: echo pre.print_r($chk)./pre; It will not work. Actually, the above *does* work! It depends on how

RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Jason Wong mailto:[EMAIL PROTECTED] on Tuesday, September 30, 2003 11:27 AM said: echo pre.print_r($chk)./pre; It will not work. Actually, the above *does* work! Not for me. (Although we may be testing different things.) ? $pageTitle = Checkout Step One; echo

RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
CPT John W. Holmes mailto:[EMAIL PROTECTED] on Tuesday, September 30, 2003 11:32 AM said: Note that print_r() will (by default) return a 1 (TRUE) upon success, so you end up with a 1 being printed at the end of your data. [snip] That answers it! c. -- PHP General Mailing List

RE: [PHP] arrays and php

2003-09-30 Thread Chris Shiflett
--- Chris W. Parker [EMAIL PROTECTED] wrote: What's the difference between using , or . for concatenation? (I thought they were the same.) The comma isn't concatenation; echo can take multiple arguments. I've heard statements about passing multiple arguments to echo being faster than using

Re: [PHP] arrays and php

2003-09-30 Thread CPT John W. Holmes
From: Chris W. Parker [EMAIL PROTECTED] CPT John W. Holmes mailto:[EMAIL PROTECTED] on Tuesday, September 30, 2003 11:32 AM said: Note that print_r() will (by default) return a 1 (TRUE) upon success, so you end up with a 1 being printed at the end of your data. [snip] That answers

RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Chris Shiflett mailto:[EMAIL PROTECTED] on Tuesday, September 30, 2003 11:39 AM said: The comma isn't concatenation; echo can take multiple arguments. Oh ok, I get it. I've heard statements about passing multiple arguments to echo being faster than using concatenation, but every

Re: [PHP] arrays and php

2003-09-30 Thread Jason Wong
On Wednesday 01 October 2003 02:32, Chris W. Parker wrote: Jason Wong mailto:[EMAIL PROTECTED] on Tuesday, September 30, 2003 11:27 AM said: echo pre.print_r($chk)./pre; It will not work. Actually, the above *does* work! Not for me. (Although we may be testing different things.)

Re: [PHP] arrays and php

2003-09-30 Thread Eugene Lee
On Tue, Sep 30, 2003 at 09:10:44AM -0700, Chris W. Parker wrote: : : Angelo Zanetti mailto:[EMAIL PROTECTED] : on Tuesday, September 30, 2003 5:43 AM said: : : hi I have a table with rows and each row contains a checkbox ( array) : and a record. TD of the checkbox: : echo(td width=15

RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Eugene Lee mailto:[EMAIL PROTECTED] on Tuesday, September 30, 2003 2:12 PM said: A heredoc is more readable: echo HTMLTAG td width=15 bgcolor=#9FD9FFinput type=checkbox name=chkR[] value={$chkSessionF[$i]}/td HTMLTAG; Yeah, but I don't like those. :P chris. -- PHP General Mailing

Re: [PHP] Arrays and Alphabetical order

2003-07-22 Thread David Nicholson
Hello, This is a reply to an e-mail that you wrote on Tue, 22 Jul 2003 at 17:40, lines prefixed by '' were originally written by you. I need it to echo out a table with all the A's first, then a blank line, then all the B's, a blank line and so on. I could write 26 different queries, one for

Re: [PHP] Arrays and Alphabetical order

2003-07-22 Thread Liam Gibbs
I need it to echo out a table with all the A's first, then a blank line, then all the B's, a blank line and so on. I could write 26 different queries, one for each letter of the alphabet, but surely there is a tidier way. Do a query, sorting by the field you need alphabetized. Then do this (and

Re: [PHP] Arrays and Alphabetical order

2003-07-22 Thread Evan Nemerson
/* UNTESTED - and prolly could be more efficient */ $c = $d = ''; natsort($info); foreach ( $info as $i ) { $d = substr($i, 0, 1); if ( $d != $c ) echo \n; echo $i; $c = $d; } On Tuesday 22 July 2003 09:40 am, Don Mc Nair wrote: Hi folks I am

RE: [PHP] Arrays

2003-03-16 Thread John W. Holmes
$var = array ( 'AN' = array ( 'Description' = 'Accession Number: (AN)', 'ReferenceURL' = 'AN__Accession_Number.jsp', ), 'AU' = array ( 'Description' = 'Author(s): (AU)',

Re: [PHP] Arrays

2003-03-16 Thread John Taylor-Johnston
Thanks! John W. Holmes wrote: $var = array ( 'AN' = array ( 'Description' = 'Accession Number: (AN)', 'ReferenceURL' = 'AN__Accession_Number.jsp', ), 'AU' = array ( 'Description' =

Re: [PHP] Arrays and MySQL

2003-03-02 Thread Marek Kilimajer
Cannot you just make MaSQL count it? $query = select sum(goals), sum(assists), sum(points) from roster; Beauford.2002 wrote: Hi, I have an array which I am trying to total but having some problems. Any help is appreciated. Example: This is a hockey team and there are 20 players - I am

Re: [PHP] Arrays and MySQL

2003-03-02 Thread Beauford.2002
[EMAIL PROTECTED] To: Beauford.2002 [EMAIL PROTECTED] Cc: PHP General [EMAIL PROTECTED] Sent: Sunday, March 02, 2003 11:10 AM Subject: Re: [PHP] Arrays and MySQL Cannot you just make MaSQL count it? $query = select sum(goals), sum(assists), sum(points) from roster; Beauford.2002 wrote: Hi

Re: [PHP] Arrays and MySQL

2003-03-02 Thread Jason Wong
On Sunday 02 March 2003 23:34, Beauford.2002 wrote: Hi, I have an array which I am trying to total but having some problems. Any help is appreciated. Example: This is a hockey team and there are 20 players - I am selecting the goals, assists, and points from each player and then want to

Re: [PHP] Arrays and MySQL

2003-03-02 Thread Leo Spalteholz
On March 2, 2003 01:53 pm, Jason Wong wrote: On Sunday 02 March 2003 23:34, Beauford.2002 wrote: Hi, I have an array which I am trying to total but having some problems. Any help is appreciated. Example: This is a hockey team and there are 20 players - I am selecting the goals,

Re: [PHP] Arrays and MySQL

2003-03-02 Thread Beauford.2002
be appreciated. From below - $totals[0][4] through $totals[19][4] , $totals[0][5] through $totals[19][5], etc. - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 02, 2003 4:53 PM Subject: Re: [PHP] Arrays and MySQL On Sunday 02 March 2003 23:34

Re: [PHP] Arrays of strings from regex

2002-12-31 Thread Marek Kilimajer
David Pratt wrote: Am working through document to collect pieces that match and then insert them into an array so they can be used to construct another file. Looking in my doc for lines like this: {\*\cs43 \additive \sbasedon10 db_edition;} {\*\cs44 \additive \sbasedon10 db_editor;}

  1   2   >