RE: [PHP] Array Question

2002-10-30 Thread Ford, Mike [LSS]
-Original Message- From: PHP List [mailto:php_list;ibcnetwork.net] Sent: 29 October 2002 17:20 To: php Subject: Re: [PHP] Array Question No, array_keys does not do what I want, in order to user array_keys, it assumes I know the value of the key, but I don't, Er -- no. Go

[PHP] array question

2002-10-30 Thread John Meyer
When retrieving an array from $_POST, which is the right way: $arrInterests = $_POST[interests[]]; or $arrInterests = $_POST[interests]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] array question

2002-10-30 Thread Rick Emery
What happened when you tried both methods? - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 10:29 AM Subject: [PHP] array question When retrieving an array from $_POST, which is the right way: $arrInterests = $_POST

RE: [PHP] array question

2002-10-30 Thread John Meyer
Either way, I'm not getting the interests. -Original Message- From: Rick Emery [mailto:remery;emeryloftus.com] Sent: Wednesday, October 30, 2002 9:34 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] array question What happened when you tried both methods? - Original Message - From

Re: [PHP] array question

2002-10-30 Thread Rick Emery
What does you HTML look like? - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 10:36 AM Subject: RE: [PHP] array question Either way, I'm not getting the interests. -Original Message- From: Rick Emery [mailto:remery

Re: [PHP] array question

2002-10-30 Thread @ Edwin
Hello, John Meyer [EMAIL PROTECTED] wrote: Either way, I'm not getting the interests. ...[snip]... When retrieving an array from $_POST, which is the right way: $arrInterests = $_POST[interests[]]; or $arrInterests = $_POST[interests]; Try this instead: $arrInterests =

Re: [PHP] array question

2002-10-30 Thread Philip Olson
[EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 10:36 AM Subject: RE: [PHP] array question Either way, I'm not getting the interests. -Original Message- From: Rick Emery [mailto:remery;emeryloftus.com] Sent: Wednesday, October 30, 2002 9:34 AM

RE: [PHP] Array Question

2002-10-29 Thread Ford, Mike [LSS]
-Original Message- From: PHP List [mailto:php_list;ibcnetwork.net] Sent: 28 October 2002 22:48 To: php Subject: [PHP] Array Question Hi, Lets say I have a simple array like this: $myarray = array(a=b,d=c); echo $myarray[0] will return 'b'; How can I get the name

Re: [PHP] Array Question

2002-10-29 Thread Brent Baisley
Perhaps you want to look at array_keys(). On Monday, October 28, 2002, at 05:48 PM, PHP List wrote: How can I get the name of the index? -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 --

Re: [PHP] Array Question

2002-10-29 Thread PHP List
No, array_keys does not do what I want, in order to user array_keys, it assumes I know the value of the key, but I don't, I want to get the value of the key but all I know is the index. Perhaps you want to look at array_keys(). On Monday, October 28, 2002, at 05:48 PM, PHP List wrote: How

Re: [PHP] Array Question

2002-10-28 Thread PHP List
This doesn't seem to work for anything past the first key: echo array_search(0,$myarray); will print 'a'; None of these give me anything: echo array_search(1,$myarray); echo array_search(1,$myarray); echo array_search(1,$myarray,true); echo array_search(1,$myarray,true); so how do I get 'd'?

[PHP] =array within an html table=

2002-10-08 Thread Anthony Ritter
I'd like to have the record data - $current - *within* the html table but if I run this script it is on a line outside of the table: ? $content = file(http://waterdata.usgs.gov/ny/nwis/uv?format=rdbperiod=1site_no=01427 510); array_pop($content); $current =

RE: [PHP] =array within an html table=

2002-10-08 Thread John W. Holmes
: Anthony Ritter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 08, 2002 11:35 PM To: [EMAIL PROTECTED] Subject: [PHP] =array within an html table= I'd like to have the record data - $current - *within* the html table but if I run this script it is on a line outside of the table

[PHP] Array getting chopped up

2002-10-05 Thread PHP
Hello, I'm having a problem on my server where any time there is more than one element in an array, all elements prior to the last one get a portion of the beginning chopped off. This portion is pretty random (I have yet to find any pattern) other than it seems if there is a space it will chop

[PHP] array trim

2002-09-17 Thread icgphp
Hello, is their a way to go through the $_POST array and do a str_replace on each one so i do not have to do this $_POST[]=str_replace(,$_POST[]); to each of the POST variables? Thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Array - Match

2002-09-07 Thread N. Pari Purna Chand
I have $sub = abc; and $subs[0] = cde; $subs[0] = iyu; $subs[0] = abc; .. .. .. $subs[50] = xyx; How to find whether $sub matches with any one of $subs[$i] I have used a for loop but it is returning true when $subs[$i] = xabc. /Chandu

Re: [PHP] Array - Match

2002-09-07 Thread Bas Jobsen
? $sub = abcd; $subs[] = cde; $subs[] = iyu; $subs[] = abc; $subs[] = xyx; $match=false; foreach($subs as $value) { if($sub==$value){$match=true; break;} } if($match) echo 'found!'; else echo 'not found!'; //or better use //for PHP 4 if(in_array($sub,$subs))echo 'found!'; else echo 'not

Re: [PHP] Array - Match

2002-09-07 Thread Jed Verity
Hello Chandu, You can use in_array(needle, haystack) for this. For example, if (in_array(abc,$subs)) {item found, do stuff...} HTH! Jed On the threshold of genius, N. Pari Purna Chand wrote: I have $sub = abc; and $subs[0] = cde; $subs[0] = iyu; $subs[0] = abc; .. .. ..

[PHP] Array Javascript

2002-09-05 Thread kale
Hy, I have an array make with a javascript. How can I read values with PHP from it? Kale. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array Javascript

2002-09-05 Thread Justin French
You can't. Javascript happens on the client side AFFTER PHP has happend on the server side. For PHP to ready variables made with javascrip,t you'd have to submit those variables/arrays via POST of GET to the PHP file. Justin on 05/09/02 9:11 PM, kale ([EMAIL PROTECTED]) wrote: Hy, I have

RE: [PHP] Array Javascript

2002-09-05 Thread Scott Houseman
); $iSubscript++ ) { // Add each member of the php array to the JS array echo 'JSArray['.$iSubscript.'] = '.$Array[$iSubscript].';'; } ? /SCRIPT Regards -|Scott -Original Message- From: kale [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 1:12 PM To: [EMAIL

Re: [PHP] Array Javascript

2002-09-05 Thread Marek Kilimajer
var tmp,url; url = 'http://site/script.php?'; while(tmp = myArray.shift()) { url += 'phparray[]' + escape(tmp); } document.location.href = url; In script.php, you'll find array named phparray kale wrote: Hy, I have an array make with a javascript. How can I read values with PHP from it?

Re: [PHP] Array Javascript

2002-09-05 Thread Marek Kilimajer
I forgot , the right version: var tmp,url,separator; url = 'http://site/script.php?'; while(tmp = myArray.shift()) { url += separator + 'phparray[]' + escape(tmp); separator = ''; } document.location.href = url; Marek Kilimajer wrote: var tmp,url; url = 'http://site/script.php?';

Re: [PHP] Array Javascript

2002-09-05 Thread Marek Kilimajer
To: PHP Subject: Re: [PHP] Array Javascript var tmp,url; url = 'http://site/script.php?'; while(tmp = myArray.shift()) { url += 'phparray[]' + escape(tmp); } document.location.href = url; In script.php, you'll find array named phparray kale wrote: Hy, I have an array make

[PHP] Array query - finding the key for a value

2002-08-16 Thread Tim Fountain
This may be a silly question, but I'm used to being able to find PHP functions to do whatever I want, but I can't find one to do this! If I have an array like this: [0] - 'apple'; [1] - 'pear'; [2] - 'orange'; [3] - 'apricot'; I know I can use in_array() to check whether, say, 'orange' is in

Re: [PHP] Array query - finding the key for a value

2002-08-16 Thread Jason Wong
On Friday 16 August 2002 19:50, Tim Fountain wrote: This may be a silly question, but I'm used to being able to find PHP functions to do whatever I want, but I can't find one to do this! If I have an array like this: [0] - 'apple'; [1] - 'pear'; [2] - 'orange'; [3] - 'apricot'; I know

RE: [PHP] Array query - finding the key for a value

2002-08-16 Thread Matt Schroebel
From: Tim Fountain [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 7:51 AM Subject: [PHP] Array query - finding the key for a value This may be a silly question, but I'm used to being able to find PHP functions to do whatever I want, but I can't find one to do this! If I have

[PHP] array and a class

2002-08-16 Thread Pafo
i got my nice looking class like this: ?php class Relic { var $RelicName; var $RelicType; var $RelicRealm; var $RelicOwner; function PrintInfo() { print $this-RelicName : $this-RelicType : $this-RelicRealm : $this-RelicOwnerbr; } function CheckForPrint() { if

[PHP] Array question

2002-08-14 Thread Brad Harriger
I have a program containing an array called $thisArray. At some point in the program, the value of next($thisArray) is an array ($subArray). How can I echo the name of the of the second array (subArray)? The name of the sub array may change at any time, so I can't just hard code it. Thanks

Re: [PHP] Array question

2002-08-14 Thread Bas Jobsen
How can I echo the name of the of the second array (subArray)? The name for value ?php $test=array ( 'a'=array('1','2'.'3'), 'c'=array('6','5'.'4'), 'd'=array('8','9'.'10'),

[PHP] Parsing XML into PHP array.

2002-08-02 Thread Scott Fletcher
I'm having trouble getting the XML string to be broken up into the PHP array. Here's how it work. I send the XML request in a string to the credit bureau through cURL and vice versa. Most of the PHP scripting I found everywhere spoke about breaking up the xml tag into the array only when

Re: [PHP] Parsing XML into PHP array.

2002-08-02 Thread Analysis Solutions
I send the XML request in a string to the credit bureau through cURL and vice versa. Most of the PHP scripting I found everywhere spoke about breaking up the xml tag into the array only when they come from the file and is use for parsing. The example on my page you looked at does get the

[PHP] Array variable in Javascript PHP

2002-07-29 Thread Sheni R. Meledath
Hello: In a form I am using a series of check boxes for a number of lists. Some calculations has to be done on the client side using Javascript depending upon the check box values. For this I am using a single variable name (array) for the check boxes in a list and another for the next list

[PHP] Array variable in Javascript PHP

2002-07-29 Thread Sheni R. Meledath
Hello: In a form I am using a series of check boxes for a number of lists. Some calculations has to be done on the client side using Javascript depending upon the check box values. For this I am using a single variable name (array) for the check boxes in a list and another for the next list

Re: [PHP] Array variable in Javascript PHP

2002-07-29 Thread Danny Shepherd
- From: Sheni R. Meledath [EMAIL PROTECTED] To: PHP Masters [EMAIL PROTECTED] Sent: Monday, July 29, 2002 4:11 PM Subject: [PHP] Array variable in Javascript PHP Hello: In a form I am using a series of check boxes for a number of lists. Some calculations has to be done on the client side using

Re: [PHP] Array variable in Javascript PHP

2002-07-29 Thread Martin Clifford
PHP cannot read a JavaScript array, simple as that. There are many workarounds, depending upon your situation. You can, for instance, create a function that is called onsubmit, that will take any values in checked checkboxes and put them into a comma-delimitted string inside a hidden form

[PHP] ARRAY, IF INSERT

2002-06-21 Thread César Aracena
Hi all. I have this form in which one Administrator can insert new members and after that, in another page, a form where he/she can insert the new member’s sons daughters. I want to display a table with “text inserts” into the admin can type let’s say a maximum of 5 kids in the second page.

Re: [PHP] Array into database

2002-06-12 Thread Leon Mergen
Stuart Dallas [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... As far as I know, serialize will handle multi-dimensional arrays. If I were you I would suck it and see. And how should I store a serialized variable in my database? As String or as Blob? -- PHP

[PHP] Array questions...

2002-06-12 Thread Leon Mergen
Hello, Assume I have the following array: $array = array ( apple = cherry, foo = bar, wom = bat ); How could I easy remove the key and the value of the key foo from that array? Also, what is the best (and quickest) way to add a key with a value to the end of this array? Thanks in advance,

AW: [PHP] Array questions...

2002-06-12 Thread Martin Lucas
hi leon, Hello, Assume I have the following array: $array = array ( apple = cherry, foo = bar, wom = bat ); How could I easy remove the key and the value of the key foo from that array? unset ($array[foo]); Also, what is the best (and quickest) way to add a key

[PHP] Array Sorting

2002-06-12 Thread Steve Buehler
I have looked through php.net and the books that I have and I am confused, so I hope that someone can help me out here. I am trying to sort an array that I have. I use a while statement to fill the array: $teams[++$i][team_id]=$row-team_id; $teams[$i][name]=$row1-name;

RE: [PHP] Array into database

2002-06-12 Thread Lazor, Ed
Depends on the average size of data that you're working with. You have to count how many bytes each array take up. I think the sizeof function will do this for you. -Ed -Original Message- And how should I store a serialized variable in my database? As String or as Blob?

Re[2]: [PHP] Array into database

2002-06-12 Thread Stuart Dallas
On Wednesday, June 12, 2002 at 7:18:18 AM, you wrote: And how should I store a serialized variable in my database? As String or as Blob? Since serialize returns a string, I would guess that you store it in a mongoose. Sorry for the sarcasm, but it's getting late and that info is on the manual

[PHP] Array into database

2002-06-11 Thread Leon Mergen
Hello, I would like to know wether it's possible to put an array into a database? If not, what is the best way to archieve something like that? Thanks in advance, Leon Mergen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array into database

2002-06-11 Thread Stuart Dallas
On Tuesday, June 11, 2002 at 10:25:36 PM, you wrote: I would like to know wether it's possible to put an array into a database? If not, what is the best way to archieve something like that? Yes it is. See http://www.php.net/serialize -- Stuart -- PHP General Mailing List

Fw: [PHP] Array into database

2002-06-11 Thread Kevin Stone
] To: [EMAIL PROTECTED] Sent: Tuesday, June 11, 2002 3:25 PM Subject: [PHP] Array into database Hello, I would like to know wether it's possible to put an array into a database? If not, what is the best way to archieve something like that? Thanks in advance, Leon Mergen -- PHP General

Re: [PHP] Array into database

2002-06-11 Thread Leon Mergen
So this would handle 2-demensional arrays too? So, if I have $array = ( foo = bar, wom = bat ); it would work? And darn, that I didn't come up with this (I'm familliar with Java, and they use Serializable) ... Stuart Dallas [EMAIL PROTECTED] wrote in message [EMAIL

Re: [PHP] Array into database

2002-06-11 Thread Stuart Dallas
On Tuesday, June 11, 2002 at 10:59:00 PM, you wrote: So this would handle 2-demensional arrays too? So, if I have $array = ( foo = bar, wom = bat ); (erm, i know it's late, but that looks like a 1-dimensional associative array) it would work? As far as I know, serialize

Fw: [PHP] Array into database

2002-06-11 Thread Kevin Stone
Yes I believe serialize will work with any array. When you extract it from the database simply do $array = unserialize($str) to rebuild the array. -Kevin - Original Message - From: Leon Mergen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 11, 2002 3:59 PM Subject: Re: [PHP

[PHP] Array question - Finding the name

2002-06-07 Thread Phil Schwarzmann
Let's say I have an array... $my_array[] = array('bob' = $x, 'jim' = $y, 'mike' = $z); Now I want to find the name of the second element in the array (I want my result to be 'jim') How do I do this? I think I might have to use the key() function but I can't quite get it to wkr. Thanks!

Re: [PHP] Array question - Finding the name

2002-06-07 Thread Jason Wong
On Friday 07 June 2002 22:16, Phil Schwarzmann wrote: Let's say I have an array... $my_array[] = array('bob' = $x, 'jim' = $y, 'mike' = $z); you probably meant to define it as: $my_array = array('bob' = $x, 'jim' = $y, 'mike' = $z); use print_r($my_array) to see the difference between

Re: [PHP] Array question - Finding the name

2002-06-07 Thread Phil Schwarzmann
Thanks for your reply! I tried using array_slice but I don't think that's exactly that I want to do. I want to find the name of the n-th value in an array. Not the value of the n-th, but whatever name was given to it. Array_slice seems to just pull part of an array and put it in another. and

Re: [PHP] Array question - Finding the name

2002-06-07 Thread Jason Wong
On Friday 07 June 2002 23:59, Phil Schwarzmann wrote: Thanks for your reply! I tried using array_slice but I don't think that's exactly that I want to do. I want to find the name of the n-th value in an array. Not the value of the n-th, but whatever name was given to it. Array_slice

Re: [PHP] Array question - Finding the name

2002-06-07 Thread Philip Olson
I want to find the name of the n-th value in an array. Not the value of the n-th, but whatever name was given to it. Array_slice seems to just pull part of an array and put it in another. and key() isn't exactly what i want either.. Maybe this will help: $my_array = array('bob' = $x,

Re: [PHP] long PHP array and HTML forms question

2002-06-06 Thread Steven Jarvis
Jason Wong wrote: Page 2: I want the user to be able to use none, some, or all of the fields, so I don't know how many elements will be in the array. $color[] = $_POST[color]; That should be: $color = $_POST[color]; Actually from your results below it seems like you've enabled

[PHP] long PHP array and HTML forms question

2002-06-05 Thread Steven Jarvis
I'm trying to store an array in a mysql db. I'm creating the array variable through an html form and passing it to the page where I store it in the db. I want to create the array with a form, store it in the db, then display it in another form with a select statement. However, I'm getting

Re: [PHP] long PHP array and HTML forms question

2002-06-05 Thread Jason Wong
On Thursday 06 June 2002 12:03, Steven Jarvis wrote: I'm trying to store an array in a mysql db. I'm creating the array variable through an html form and passing it to the page where I store it in the db. I want to create the array with a form, store it in the db, then display it in another

[PHP] Array of COM objects doesn't work in PHP but does in ASP?

2002-05-30 Thread Noah
Hey guys, OK I favor PHP so far above ASP however it doesnt seem like PHP can handle an array of COM Objects. Here's the scenario: Within the 'Deal' object contains an array of 'Bonds'. I want to access each bond by doing: $comDeal-Bonds-Item[$i]; ( btw Item is part of

[PHP] array question

2002-05-30 Thread Michelle
I'm a newbie at php and I'm sure you will be able to tell by my question. I'm just doing a simple form but my head is hurting from trying to figure out the correct syntax. I'm posting the form to $PHP_SELF an example from my $form_block = pb*/bYour Name:br / INPUT type=\text\

RE: [PHP] array question

2002-05-30 Thread Martin Towell
$_POST[product][0] $_POST[product][1] etc. -Original Message- From: Michelle [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 9:25 AM To: [EMAIL PROTECTED] Subject: [PHP] array question I'm a newbie at php and I'm sure you will be able to tell by my question. I'm just doing

Re: [PHP] array question

2002-05-30 Thread Analysis Solutions
On Thu, May 30, 2002 at 07:24:49PM -0400, Michelle wrote: pPhone Number:br / INPUT type=\text\ name=\phone\ value=\$_POST[phone]\ size=30/p which finally leads to my question how do I do the $_POST[var] when it's an array(checkbox or radio button)? ex: input type=\checkbox\

[PHP] Array question - Please help

2002-05-23 Thread Dan McCullough
Here is the problem. I have over 60 subdomains to check on a regular basis. I wrote a php script that gets a list from a text file and then checks whether it can open that domain/subdomain. That works great. My problem is that everything is lumped together, so I have to scan a list of 60

Re: [PHP] Array question - Please help

2002-05-23 Thread Jason Wong
On Friday 24 May 2002 01:03, Dan McCullough wrote: Here is the problem. I have over 60 subdomains to check on a regular basis. I wrote a php script that gets a list from a text file and then checks whether it can open that domain/subdomain. That works great. My problem is that everything

Re: [PHP] Array question - Please help

2002-05-23 Thread 1LT John W. Holmes
in a url, w/o having to put zero, zero, and None for the other columns. adapt to your needs. ---John Holmes... - Original Message - From: Dan McCullough [EMAIL PROTECTED] To: PHP General List [EMAIL PROTECTED] Sent: Thursday, May 23, 2002 1:03 PM Subject: [PHP] Array question - Please help

[PHP] array empty after use

2002-05-21 Thread Web
Hi there. When an array is 'used' with something like do while I can't re-access it later in the page. It is as if the array gets used up and doesn't exist. The array is from a select statement using myself. I have inserted a duplicate array with a different name to get around this but figure

Re: [PHP] array empty after use

2002-05-21 Thread Tom Rogers
Hi You just need to reset the array pointer with reset($array_name) Tom At 07:47 PM 21/05/2002, Web wrote: Hi there. When an array is 'used' with something like do while I can't re-access it later in the page. It is as if the array gets used up and doesn't exist. The array is from a select

Re: [PHP] array empty after use

2002-05-21 Thread Jim lucas
when you loop through a mysql result set you move the pointer up one place. you need to use the mysql_data_seek($results, 0); to reset the pointer Jim Lucas - Original Message - From: Web [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 2:47 AM Subject: [PHP] array

RE: [PHP] array empty after use

2002-05-21 Thread David Freeman
When an array is 'used' with something like do while I can't re-access it later in the page. Arrays have a pointer that steps through the array as you 'use' it. Once you reach the end you'll have to reset that pointer before you can step through the array again. See the manual section on

[PHP] array question

2002-05-17 Thread Josh Edwards
I have an array which I use a loop to add numbers to different elements in the array. I can extract the highest no which in this case is 48. ie ([22 ] = 48 [23 ] = 2 [12 ] = 22 [14 ] = 5 ) Using this highest no (48 in this instance), how do I get the position or [element No] that matches the

Re: [PHP] array question

2002-05-17 Thread Jason Wong
On Friday 17 May 2002 18:42, Josh Edwards wrote: I have an array which I use a loop to add numbers to different elements in the array. I can extract the highest no which in this case is 48. ie ([22 ] = 48 [23 ] = 2 [12 ] = 22 [14 ] = 5 ) Using this highest no (48 in this instance), how do I

[PHP] Array problems again

2002-05-17 Thread Josh Edwards
Here's a sample of a weblog. I have a loop that extracts the request ie Get /A1.php How do I get the top ten requests and how many time these were requested after looping thru the whole file. Can you set up an array that is self populating if a string doesn't match an element in the array or is

Re: [PHP] Array problems again

2002-05-17 Thread Jason Wong
On Friday 17 May 2002 21:20, Josh Edwards wrote: Here's a sample of a weblog. I have a loop that extracts the request ie Get /A1.php How do I get the top ten requests and how many time these were requested after looping thru the whole file. Can you set up an array that is self populating if

[PHP] array search in 2-D arrays

2002-05-15 Thread Pushkar Pradhan
I've a 2 D array and would like to search for vals. in the first dimension only i.e. myArray[0][0] myArray[1][0] myArray[2][0] myArray[3][0] . . . and not in the elements myArray[0][1] CODE: for($l = 0; $l count($layer); $l++) { $key = array_search($layer[$l], $layerDes); // $layerDes

Re: [PHP] array search in 2-D arrays

2002-05-15 Thread Pushkar Pradhan
Oops! Sorry I got a reply for this but didn't read my mail carefully enough. Thanks to Tim Ward for pointing out the problem. I've a 2 D array and would like to search for vals. in the first dimension only i.e. myArray[0][0] myArray[1][0] myArray[2][0] myArray[3][0] . . . and not in the

[PHP] Array usage affecting server

2002-05-10 Thread Kevin Meredith
Hi. When a database query is done and the results are put into an array, what are the resources used? I name all arrays differently and was wondering how it would affect the performance of the server if many people connected with many arrays being full. I am assuming the array gets 'dropped'

Re: [PHP] Array usage affecting server

2002-05-10 Thread Miguel Cruz
On Fri, 10 May 2002, Kevin Meredith wrote: When a database query is done and the results are put into an array, what are the resources used? I name all arrays differently and was wondering how it would affect the performance of the server if many people connected with many arrays being full.

RE: [PHP] Array usage affecting server

2002-05-10 Thread John Holmes
Are you loading the entire result set of the query into an array, or just row by row? ---John Holmes... -Original Message- From: Kevin Meredith [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 11:48 PM To: PHP Subject: [PHP] Array usage affecting server Hi. When

[PHP] array of objects???

2002-05-10 Thread J. Anderson Scarbrough
I have two classes. Organization and users. In the organization class I am try to keep an array of user objects but it does not seem to be taking. Can any help? See code below. class Organization { var $users = array(); function AddUser($oUser) { array_push($this-users,

[PHP] Array loop help

2002-05-09 Thread CDitty
Can someone offer any help with the code below? I have a cookie that is set and is separated by pipes (|). For each segment, I have to look up the id in a text file. I can loop through the cookie and get each segment, but when I open the text file and loop through it, it only matches the first

[PHP] array question--help

2002-04-27 Thread Mark Pelillo
I am a Newbie at PHP I am sure I am missing something small but... I am trying to create a form selection box which an alphabetically sort list of a unix group file. The group file has the format groupname::groupnumber: I have tried to create an array using the array=fgetcsv($fp, 30, :)

RE: [PHP] Array function to delete

2002-04-26 Thread Ford, Mike [LSS]
must have an even longer memory than that, since the following script: ?php $array = array(); $array[0] = zero; $array[1] = one; $array[2] = two; $array[3] = three; unset($array[1]); echo version= . phpversion() . br; foreach ($array as $key=$value) { echo $key

Re: [PHP] Array function to delete

2002-04-26 Thread Liam Gibbs
But PHP builtins will do exactly this, around 3 times faster, too. :) Yup. This one with array_diff was the winner. Thanks to all for your suggestions and Lars for the working one. Liam __ Do You Yahoo!? Yahoo! Games - play chess, backgammon,

[PHP] Array wildcard?

2002-04-25 Thread Leif K-Brooks
Is there some array wildcard I can use? In other words, I have an array. Is there any wildcard function/character that will let me test to see if a string matches anything in that array? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Array wildcard?

2002-04-25 Thread Miguel Cruz
On Thu, 25 Apr 2002, Leif K-Brooks wrote: Is there some array wildcard I can use? In other words, I have an array. Is there any wildcard function/character that will let me test to see if a string matches anything in that array? Thanks http://php.net/in_array ? miguel -- PHP General

Re: [PHP] Array wildcard?

2002-04-25 Thread Leif K-Brooks
on 4/25/02 1:58 PM, Miguel Cruz at [EMAIL PROTECTED] wrote: On Thu, 25 Apr 2002, Leif K-Brooks wrote: Is there some array wildcard I can use? In other words, I have an array. Is there any wildcard function/character that will let me test to see if a string matches anything in that array?

Re: [PHP] Array wildcard?

2002-04-25 Thread CC Zona
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Leif K-Brooks) wrote: One more question. Is there any way to use this with part of a string? Example: function checkfruitlove($string){ $fruitarray = array(apples,oranges); if($string == I love .in_array($fruitarray).!){ $return = I do

[PHP] Array function to delete

2002-04-25 Thread Liam Gibbs
I've been checking the PHP documentation, but can't find a function that will delete a member of an array, like such: $a = array(1, 2, 3, 4, 5); Use the function, say array_delete($a, 3); and that will delete the third member in the array (which would be 4 above), so that the array would

Re: [PHP] Array function to delete

2002-04-25 Thread Erik Price
On Thursday, April 25, 2002, at 03:22 PM, Liam Gibbs wrote: I've been checking the PHP documentation, but can't find a function that will delete a member of an array, like such: $a = array(1, 2, 3, 4, 5); Use the function, say array_delete($a, 3); and that will delete the third member

Re: [PHP] Array function to delete

2002-04-25 Thread Pushkar Pradhan
As far as I know there isn't such a function, what I do to achieve this: 1. find the position of the element you want to remove 2. slice the array into 2 arrays one contains all elements before this and one contains all elements below this, 3. use shift to remove appropriate element 4. merge both

Re: [PHP] Array function to delete

2002-04-25 Thread Pushkar Pradhan
That's neat but I just read the docs. it says unset() won't work inside a function, even if you pass by reference! Anyways as far as you don't use functions to do the delete it will work fine. On Thursday, April 25, 2002, at 03:22 PM, Liam Gibbs wrote: I've been checking the PHP

Re: [PHP] Array function to delete

2002-04-25 Thread Lars Torben Wilson
On Thu, 2002-04-25 at 12:22, Liam Gibbs wrote: I've been checking the PHP documentation, but can't find a function that will delete a member of an array, like such: $a = array(1, 2, 3, 4, 5); Use the function, say array_delete($a, 3); and that will delete the third member in the array

Re: [PHP] Array function to delete

2002-04-25 Thread Nathan
[EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 1:22 PM Subject: [PHP] Array function to delete I've been checking the PHP documentation, but can't find a function that will delete a member of an array, like such: $a = array(1, 2, 3, 4, 5); Use the function, say array_delete

Re: [PHP] Array function to delete

2002-04-25 Thread Pushkar Pradhan
] To: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 1:22 PM Subject: [PHP] Array function to delete I've been checking the PHP documentation, but can't find a function that will delete a member of an array, like such: $a = array(1, 2, 3, 4, 5); Use the function, say array_delete($a, 3

Re: [PHP] Array function to delete

2002-04-25 Thread Lars Torben Wilson
. # Nathan You need to upgrade. :) The above hasn't been true for a while...at least since 4.1.2 and perhaps earlier. - Original Message - From: Liam Gibbs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 1:22 PM Subject: [PHP] Array function to delete I've

[PHP] array - change elements position

2002-04-25 Thread Evandro Sestrem
Hello, Has a automatic way to change the position from 2 elements of a array without use a aux variable? Like that: A = (1,3,2) -- A = (1, 2, 3) Thanks, Evandro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array function to delete

2002-04-25 Thread Lars Torben Wilson
On Thu, 2002-04-25 at 12:32, Pushkar Pradhan wrote: That's neat but I just read the docs. it says unset() won't work inside a function, even if you pass by reference! No, that is not at all what it says. Anyways as far as you don't use functions to do the delete it will work fine. On

Re: [PHP] Array function to delete

2002-04-25 Thread Nathan
Apparently in 4.1.X this is true... I'd been running 4.0.6 for a long time (until 4.1.2 was released), and must have coded it in the earlier version. I stand corrected! :-) A simple test to see if your version supports this: ?php $array = array(); $array[0] = zero; $array[1] = one; $array[2

Re: [PHP] Array function to delete

2002-04-25 Thread Richard Baskett
is over self. - Aristotle From: Lars Torben Wilson [EMAIL PROTECTED] Date: 26 Apr 2002 12:50:03 -0700 To: Pushkar Pradhan [EMAIL PROTECTED] Cc: Erik Price [EMAIL PROTECTED], Liam Gibbs [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [PHP] Array function to delete On Thu, 2002-04-25 at 12

Re: [PHP] Array function to delete

2002-04-25 Thread Liam Gibbs
Thanks for all your help, everyone, but both suggestions (unset and array_slice) pretty much didn't improve on my current way. I was jsut trying to find a faster way, but unset doesn't seem to be working properly (but I'll need to fiddle more) and the array_slice way is just too intensive.

Re: [PHP] Array function to delete

2002-04-25 Thread Erik Price
On Thursday, April 25, 2002, at 04:27 PM, Liam Gibbs wrote: Thanks for all your help, everyone, but both suggestions (unset and array_slice) pretty much didn't improve on my current way. I was jsut trying to find a faster way, but unset doesn't seem to be working properly (but I'll need

<    5   6   7   8   9   10   11   12   13   >