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 > 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-26 Thread tamouse mailing lists
On Mon, Feb 25, 2013 at 9:51 PM, Karl DeSaulniers 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-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, X

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 => arr

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

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 Adam Richardson
On Mon, Feb 25, 2013 at 8: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( >

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

Re: [PHP] Arrays: Comma at end?

2012-02-08 Thread Micky Hulse
On Wed, Feb 8, 2012 at 10:08 AM, Robert Cummings 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 wrote: > I am just surprised th

Re: [PHP] Arrays: Comma at end?

2012-02-08 Thread Micky Hulse
On Wed, Feb 8, 2012 at 9:58 AM, Larry Garfield 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 syntax guideline/rule 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: ... 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 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: ... and it looks like having that comma ain't no big deal. I can't believe that I alw

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Ghodmode
On Wed, Feb 8, 2012 at 4:10 AM, Ashley Sheridan 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 actually encourage it,

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
On Tue, Feb 7, 2012 at 12:32 PM, Ashley Sheridan 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 your array. Clearly, appl

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 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 Robert Williams
On 2/7/12 13:15, "Paul M Foster" 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 supported syntax:

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
On Tue, Feb 7, 2012 at 12:19 PM, Micky Hulse 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 is all noob st

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
On Tue, Feb 7, 2012 at 12:15 PM, Paul M Foster 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 my few simple tests,

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
Hi Ashley! Thanks for your quick and informative reply, I really appreciate it. :) On Tue, Feb 7, 2012 at 12:10 PM, Ashley Sheridan 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 the trailing comma, as

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: > > > > ... and it looks like having that comma ain't no

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: > > > > ... and it looks like having that comma ain't no big de

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

Re: [PHP] Arrays & Regexp - Help Requested

2010-01-01 Thread Mari Masuda
I think the problem is here: echo 'default text. It looks like your code is trying to make a textarea that starts with http://www.w3.org/TR/html401/interact/forms.html#h-17.7 for how to use textarea. On Jan 1, 2010, at 3:38 PM, Allen McCabe wrote: > echo ' if ($input_type == 'text') >

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 th

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 th

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 menusyst

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 i

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 = mysql_feth_array($reau

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

Re: [PHP] arrays

2006-06-09 Thread Mariano Guadagnini
Jesús Alain Rodríguez 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 = array_me

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.

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 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-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: Sent: Saturday, February 04, 2006 11:1

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 $sS

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

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 -- http:

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 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) "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; $i Array

RE: [PHP] Arrays

2005-07-12 Thread yanghshiqi
le is okey. 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: &g

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[] = $produ

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

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 sin

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. Array Example"); echo (""); for ($i=0; $i echo (

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
ginal 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 var

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 wi

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 y

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

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 matter

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 . ""; >} "foreach" needs an "as",

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: foreach(array_sli

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

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']; $coor1=mycoors(

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

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 so

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 t

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 > on We

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

2004-03-10 Thread Chris W. Parker
Luis Mirabal 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

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 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 on Wednesday, March 10, 2004 12:25 AM said: > would the following example be

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

2004-03-10 Thread Chris W. Parker
Jason Davidson 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 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 s

RE: [PHP] arrays and sessions

2004-02-27 Thread Chris W. Parker
Kermit Short 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 >

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 recent

RE: [PHP] arrays and sessions

2004-02-27 Thread Chris W. Parker
Kermit Short 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 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 n

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 t

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 millio

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. Th

RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Eugene Lee on Tuesday, September 30, 2003 2:12 PM said: > A heredoc is more readable: > > echo << value="{$chkSessionF[$i]}"> > HTMLTAG; Yeah, but I don't like those. :P chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.

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 : 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(" value=". $

Re: [PHP] arrays and php

2003-09-30 Thread Jason Wong
On Wednesday 01 October 2003 02:32, Chris W. Parker wrote: > Jason Wong > > on Tuesday, September 30, 2003 11:27 AM said: > echo "".print_r($chk).""; > > It will not work. > > > > Actually, the above *does* work! > > Not for me. (Although we may be test

RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Chris Shiflett 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 benc

Re: [PHP] arrays and php

2003-09-30 Thread CPT John W. Holmes
From: "Chris W. Parker" <[EMAIL PROTECTED]> > CPT John W. Holmes > 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]

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 usin

RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
CPT John W. Holmes 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 (h

RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Jason Wong on Tuesday, September 30, 2003 11:27 AM said: echo "".print_r($chk).""; It will not work. > > Actually, the above *does* work! Not for me. (Although we may be testing different things.) ".print_r($pageTitle).""; ?> Gives me: Checkout S

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 > > > > on Tuesday, September 30, 2003 11:06 AM said: > > >> echo "".print_r($chk).""; > > >> > > >> It will not work. > > Actually, the above *does* wo

Re: [PHP] arrays and php

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

Re: [PHP] arrays and php

2003-09-30 Thread Jason Wong
On Wednesday 01 October 2003 02:14, Chris W. Parker wrote: > Jason Wong > > on Tuesday, September 30, 2003 11:06 AM said: > >> echo "".print_r($chk).""; > >> > >> It will not work. Actually, the above *does* work! -- Jason Wong -> Gremlins Associates -> www.gremlin

RE: [PHP] arrays and php

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

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 ""; > print_r($chk); > echo ""; > > Quick side note on the above code: > > You cannot write it like: > > echo "".print_r($chk).""; > > It will not work.

RE: [PHP] arrays and php

2003-09-30 Thread Chris W. Parker
Angelo Zanetti 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(" value=". $chkSessionF[$i] .">"); Firstly you should be putting double quotes around every

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 a

Re: [PHP] Arrays and Alphabetical order

2003-07-22 Thread Liam Gibbs
<> Do a query, sorting by the field you need alphabetized. Then do this (and tidy it up as you need): echo ""; while($result = mysql_fetch_row$(query)) { if(substr($result, 0, 1) != $previousfirstletter) { $previousfirstletter = substr($result, 0, 1); echo "$previousfirstletter";

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, on

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 ( > > 'Desc

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 and MySQL

2003-03-02 Thread Beauford.2002
s it would 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

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

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

Re: [PHP] Arrays and MySQL

2003-03-02 Thread Beauford.2002
Kilimajer" <[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? > > $que

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 sele

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;} {\*\cs45

  1   2   >