A couple of simple ones here ... the usual references don't appear to give
a straightforward answer on these:
Can arrays be passed to functions just like a simple variable?
Can arrays be passed as values in hidden form fields just like a
simple variable?
I've been playing around with these and
Your code looks fine. Are you sure you haven't edited away significant
parts of it when posting to the list? Maybe a
somewhere?
miguel
On Sun, 19 May 2002, Navid Y. wrote:
> I'm having trouble sending array values through forms.
> Will the following syntax create a variable called $product['d
On Monday 20 May 2002 07:05, Navid Y. wrote:
> Hello Everyone,
>
> I'm having trouble sending array values through forms.
> Will the following syntax create a variable called $product['desc'] on
> the next page?
> If not, what am I doing wrong here?
>
> Note: I tried this but it didn't work! When
Try:
On Mon, 20 May 2002 11:05:07 +1200, Navid Y. wrote:
> Hello Everyone,
>
> I'm having trouble sending array values through forms. Will the
> following syntax create a variable called $product['desc'] on the next
> page?
> If not, what am I doing wrong here?
>
> Note: I tried this but i
Hello Everyone,
I'm having trouble sending array values through forms.
Will the following syntax create a variable called $product['desc'] on
the next page?
If not, what am I doing wrong here?
Note: I tried this but it didn't work! When I tried doing it without
using an array, but rather with a
1) The example you have shown should work. Take a look at the foreach controle
structure. (Link at bottom of mail.)
2) You cannot assign a value to a checkbox. It can only be set by the "checked"
keyword (ie: .)
3) The value of a checked checkbox is "on". If a checkbox is not checked it will not
On Wed, 24 Apr 2002, Liam MacKenzie wrote:
>
> while ( $element = each( $games ) )
> {
> echo $element["value"];
> echo "";
> }
>
>
> I tried this too, it gave the same results as the above...
>
> if (is_array($games)) {
> for ($z=0;$z echo "$games[$z]";
> }
> }
> else {
> echo "$game
Hi all,
I have a form, with about 40 checkboxes, I want to write a PHP document that
processes the submission and displays the values of the checkboxes that were
checked.
Pretty basic stuff, I've tried a few different things, some work but display
"Array" at the top of the list of values.
C
-Natalie
-Original Message-
From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 4:45 PM
To: Leotta, Natalie (NCI/IMS)
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] arrays in a class
»Leotta, Natalie (NCI/IMS)« sagte am 2002-04-23 um 16:37:37 -0400 :
> Wow.
»Leotta, Natalie (NCI/IMS)« sagte am 2002-04-23 um 16:37:37 -0400 :
> Wow. Now I'm feeling dumb... It does work with my non-array vars though -
Yes, it doesn't suprise me that it works with non arrays. The parser
doesn't seem to be clever enough to catch that you want to pass [0] as
the array
t: Re: [PHP] arrays in a class
»Leotta, Natalie (NCI/IMS)« sagte am 2002-04-23 um 16:27:46 -0400 :
> ImageString($this->im,1,65,5,"apcs[0] =
> $this->apcs[0]",$this->black);
Hm, try to use proper syntax here, ie:
ImageString($this->im,1,65,5,"apc
»Leotta, Natalie (NCI/IMS)« sagte am 2002-04-23 um 16:27:46 -0400 :
> ImageString($this->im,1,65,5,"apcs[0] = $this->apcs[0]",$this->black);
Hm, try to use proper syntax here, ie:
ImageString($this->im,1,65,5,"apcs[0] = " . $this->apcs[0],$this->black);
Alexander Skwar
--
How to quote:
Do I have to do anything different to access an array in a class? I have
var $apcs = array();
at the top of my class
I set it using
$line1->adj_array[$pos] = (integer) $value;
in the read-in part of the app that uses the class ($line1 is the object,
$pos is just a number)
Later o
On Friday, April 5, 2002, at 03:00 PM, Brian McLaughlin wrote:
> My problem is that when I assign an empty array to a variable, I get
> different results depending on whether that variable is in an object or
> not.
> In the case of assigning $a=array(); outside of an object, each element
> of
Thank you!!
Now I need to figure out how to put all this hair back in my head.
Brian
"Rick Emery" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I corrected the syntax errors Erik found and added var_dump() after each
$t
> equation/assignment
>
> The proble
Hi Erik
Thanks for the reply. I'm not sure how I missed the opening { in my
message -- I copy/pasted the code. But the opening { is definitely there in
the code -- I'd get a nice error message if it weren't. I believe it's OK
to have a ; after the class def end-brace, but I removed it and I go
riginal Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 1:28 PM
To: 'Brian McLaughlin'; [EMAIL PROTECTED]
Subject: RE: [PHP] Arrays within classes
I corrected the syntax errors Erik found and added var_dump() after each $t
equation/assignment
The proble
if $words ="abc",
then $test->$words means $test->abc
Yes, it's in the manual
-Original Message-
From: Brian McLaughlin [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 12:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Arrays within classes
This is driving me crazy!
I might be completely mistaken here, but it looks like there are a few
errors in your code:
- No starting brace for the test() method
- semi-colon used after class def end-brace
- no parentheses after "new test" instance assignment
Don't you want to keep your class as general as possible, and p
This is driving me crazy! I've created a class to hold data so I can just
put the object into the session rather than saving off each piece of data
separately. But I'm getting odd results from the arrays in my class that I
can't explain. Here's a hunk of code that demonstrates:
$words;
ech
Hi,
Dodgy subject header or what...
I have array of strings called $composition, and I itterate through this
using:
$composition[$i]
Is there any way to echo the first character of the string by doing
something like:
$composition[$i][0] or ($composition[$i)][0] ?
I can easily just do s
I am having problem with an array filled with an object. I am trying to
access it using current($object_array)->object_var. Here is the line of
code that is giving me the problem, any help that can be provided will be
greatly appreciated.
if((current($retrieved)->beginTime > $morning) &&
(curre
This is for anyone who was following this post, I found a work-around for
the problem I was having with my array of objects.
The original code looked like this:
function getEvents($filename) {
//string $filename
$event_list = array();
$event_object = new event();
$i = 0;
@ $fp = fopen($
I am relatively new to PHP but have had some background in OOP. I am having some
trouble with a method that for a certain class. The problem is that I can seem to
read my objects from an array that I am storing them to. I keep getting the error
"Call to a member function on a non-object". I
>
Op woensdag 13 februari 2002 23:04, schreef Police Trainee:
> good evening gentlemen. I am attempting (with my oh so
> limited php writing abilities) to write a script that
> will take the second "part" of a form item's data and
> process it separately. To elaborate:
>
>
>
>
>
> When pr
list($mytext,$mynbr) = explode(","$FORM_ITEM);
-Original Message-
From: Police Trainee [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 4:05 PM
To: PHP
Subject: [PHP] arrays with form data?
good evening gentlemen. I am attempting (with my oh so
limited p
good evening gentlemen. I am attempting (with my oh so
limited php writing abilities) to write a script that
will take the second "part" of a form item's data and
process it separately. To elaborate:
When processing, I want the first part of the value
(TextHere or OtherText) to be used for on
I could be wrong about this, but here goes:
Strings are in fact arrays. An array of characters. The code your
friend gave you manipulates this array in the same way that it would any
"normal" array. The only problem (not really a problem even) is that
when dealing with character-based arra
:[EMAIL PROTECTED]]
> Sent: Friday, January 25, 2002 8:57 AM
> To: PHP List
> Subject: [PHP] Arrays as pointers?
>
>
> A friend of mine showed me this code recently.
>
> function firstLogin_string() {
> mt_srand(make_seed());
> $pool = "AaBbCcDdEeFfGgHhIiJjK
v0idnull,
[surely you don't think of yourself as a nonentity twice over?]
> A friend of mine showed me this code recently.
>
> function firstLogin_string() {
> mt_srand(make_seed());
> $pool = "AaBbCcDdEeFfGgHhIiJjKkLlM";
> $length = 26;
> for($i=0; $i < $length; $i++) {
> $key .= $pool[mt_ran
ssage-
From: v0idnull [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 25, 2002 8:57 AM
To: PHP List
Subject: [PHP] Arrays as pointers?
A friend of mine showed me this code recently.
function firstLogin_string() {
mt_srand(make_seed());
$pool = "AaBbCcDdEeFfGgHhIiJjKkLlM&qu
A friend of mine showed me this code recently.
function firstLogin_string() {
mt_srand(make_seed());
$pool = "AaBbCcDdEeFfGgHhIiJjKkLlM";
$length = 26;
for($i=0; $i < $length; $i++) {
$key .= $pool[mt_rand(0,strlen($pool)-1)];
}
retu
Hi,
Can anybody suggest a good reading on how to work with
arrays with multiple keys?
thanks.
=
Mehmet Erisen
http://www.erisen.com
__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--
PHP General Ma
Okay so I have a multidimensional associative array, $userlist[$file][$stat], $stat
only contains one value, I want to sort $userlist[$file] based off some associative
element in $stat, say like 'wins'. array_multisort isn't appropriate as far as I can
tell since $stat isn't an array, it's just
Maybe you should take a look at XSL
http://www.w3schools.com/xsl/
http://www.w3.org/Style/XSL/
-Original Message-
From: php dood [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 21, 2001 2:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] arrays
I'm trying to figure out how to parse a
I'm trying to figure out how to parse an xml document, and convert it into
html...
i know how to parse in simple xml stuff for example
easy is pretty easy to parse in, and i know how to code that,
but when you start adding flags that i'm going to need variables for,
example easy is not so easy.
*
You forgot the printf method
printf("Some text %s\n",$myhash['mykey']);
Jerry
-Original Message-
From: jimtronic [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 18, 2001 5:59 PM
To: TD - Sales International Holland B.V.
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] A
I've noticed this, too. There are at least two things you can do to
make them work...
print("Some text {$myhash['mykey']}\n")
or
print("Some text ".$myhash['mykey']."\n")
jim
>Hey there,
>
>sortta simple question... Is it just me or can't you access hashes within
>strings?
>This works...
>p
Hey there,
sortta simple question... Is it just me or can't you access hashes within
strings?
This works...
print("Some text $myarray[0]\n");
This doesn't
print("Some text $myhash['mykey']\n");
i'm asking in relation to databases (not that that matters). If i fetch a row
from the database I ca
http://php.net/array
Try $data = mysql_fetch_assoc($series)
This will produce an associative array with column names attached to
values for one row
of data from your database.
jim
>Hi,
>
>im trying to fill a chart with some data.
>
>I am using a mysql query:
>$query = "SELECT serie_tot, COUNT
Hi,
im trying to fill a chart with some data.
I am using a mysql query:
$query = "SELECT serie_tot, COUNT(*) FROM statistik WHERE shooter='mindbash'
GROUP BY serie_tot";
$series = mysql_query($query)
It returns the results i want, ie
value - count
value2 - count
etc...
Now - i am trying to get
Original Message-
From: Steve Maroney [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 22, 2001 12:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Arrays conflicting with Javascript, PLease advise?!?
Hey guys,
Im have a couple of form elements with the names of php arrays. Instead of
just u
Hey guys,
Im have a couple of form elements with the names of php arrays. Instead of
just using , Im defining the array keys.
Before the form is submitted to the PHP script, Im using javascript to
modify the element values. The array brackets that are part of the element
name are conflicting
On Friday 26 October 2001 10:17, Ashley M. Kirchner wrote:
> I'd like to create an array of "available resources", and be able
> to check it every time. What I'd like to do is something like;
>
> $site = array( "section1" => #, "section2" => #, etc.. )
>
> where "section*" is a STRING
On Sat, 27 Oct 2001 01:41, Ashley M. Kirchner wrote:
> In a different language I can write something that will return the
> index of $section in the array, then I can use that index value to fetch
> the INT afterwards:
>
> $array = {{"section1", 1},{"section2",4},{"section3",2}}
> if (idx
Brad Hubbard wrote:
> // Suck 'em in
>
> $site = array (
> "section1" => 007,
> "section2" => 11,
> "section3" => 57.5,
> "section4" => 12,
> "section10" => 1
> );
Okay, this answer the f
On Fri, 26 Oct 2001 18:17, Ashley M. Kirchner wrote:
> I'd like to create an array of "available resources", and be able to
> check it every time. What I'd like to do is something like;
>
> $site = array( "section1" => #, "section2" => #, etc.. )
>
> where "section*" is a STRING varia
I'd like to create an array of "available resources", and be able to
check it every time. What I'd like to do is something like;
$site = array( "section1" => #, "section2" => #, etc.. )
where "section*" is a STRING variable and # is an INT (if it's even
possible to do that)
O
Hi all
How can i implement a hotmail-inbox like checkbox
functionality?
thanks in adv
Regards
Srinivasan Ranganathan
Do You Yahoo!?
Send a newsletter, share photos & files, conduct polls, organize chat events. Visit
http://in.groups.
At 07:00 23/9/2001 -0700, Alawi Albaity wrote:
>hi
>
>how can I remove duplicted values (Data) in my array ?
my bad... I didn't check the manual... there's a function that does exactly
that:
http://www.php.net/manual/en/function.array-unique.php
sorry... :)
_
. Chr
At 07:00 23/9/2001 -0700, you wrote:
>hi
>
>how can I remove duplicted values (Data) in my array ?
there are several solutions to this problem, you can:
1 - use the function array_count_values() to find all the values that occur
more then once and then loop trough the result array and removing
So sprach »Alawi Albaity« am 2001-09-23 um 07:00:22 -0700 :
> how can I remove duplicted values (Data) in my array ?
array_unique
Alexander Skwar
--
How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
Homepage: http://www.digitalprojects.com | http://www.iso-to
hi
how can I remove duplicted values (Data) in my array ?
__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger.
http://im.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-m
Ok, I found out why the UPDATE on the table wasn't working. I wasn't
giving
the command a 'fake' value for the ID column. Ok here is the senario.
I have a form which dumps data to cols 1,2,3,5 in a table (thats
good). I have another script which runs a loop on the data into another
form where I
>
> mysql_auery($query) or die(echo mysql_error());
By the way, I know this line should be mysql_query
John Meyer
[EMAIL PROTECTED]
Programmer
If we didn't have Microsoft, we'd have to blame ourselves for all of our
programs crashing
--
PHP General Mailing List (
Hi, I have a multi-select listbox set up like this:
Author (you are able to select more than one.Click
here to add a new author):
" .
$row["AUTHOR_FNAME"] . " " . $row["AUTHOR_LNAME"] . "";
echo $option;
}
?>
I then have a bit of code that parses through and checks which authors th
On Fri, Jul 06, 2001 at 11:38:48AM +0100, Neil Kimber wrote:
>
> We have a nice PHP framework that handles all of of our interactions with
> Oracle via OCI calls. It works beautifully and gives us no problems.
> However, the one thing that we cannot get working is the calling of an
> Oracle store
Whats is the difference between [] and {} ?
define(NL,"\n");
$str="How do you do?";
echo $str[3].NL;
echo $str{3}.NL;
$array = array("how","do","you","do?");
echo $array[2].NL;
echo $array{2}.NL;
this outputs
d
d
you
you
so there's no diff
Hi,
PHP provides a number of array-related functions which rely on a relation
existing between each array element. This is easy to understand for
primitive types (integers, strings and so on) but how does it work for
objects?
For example, I have a class Person. I have a number of Person objects
: [EMAIL PROTECTED]
Subject: [PHP] Arrays : Key in Array, True/False
Hi there
I have a script with a function that builds a more comprehensive kind
of array for parsing arguments given a script in PHP (this is a
backup-script I'm currently working on).
My problem is in "THE PARSING OF
Hi there
I have a script with a function that builds a more comprehensive kind
of array for parsing arguments given a script in PHP (this is a
backup-script I'm currently working on).
My problem is in "THE PARSING OF ARGS PART" when I'm asking the array
if the key exists in the array it returns
Why I can get this to work?
I don't understand... I made another simple script that the only thing it
did was the "build array/serialize it/register the session var/ => next
page load unserialize it into array/update array/serialize it again".. and
it worked like a charm...
I'm doing the exact
I'm quite new at object-oriented programming in PHP. Here's what I want to do.
I want to create a class of objects called "lists". The properties I want
to have for list objects include:
owner of the list
number of items in the list
the list itself
Each item in t
On Thursday 22 February 2001 22:58, Scott Walter wrote:
> I am attempting to insert a set of data (actually a pair) into an
> array, without much success. I would like to insert the data set
> ("course number", "course title") into a numerically indexed array so
> that when I want to output the a
Try:
echo $array[$i][course_num] . ' ' . $array[$i][course_title];
-jm
-Original Message-
From: Scott Walter [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 1:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Arrays -- How do I insert a pair of data into an ar
I am attempting to insert a set of data (actually a pair) into an array,
without much success. I would like to insert the data set ("course
number", "course title") into a numerically indexed array so that when I
want to output the array I can reference it like so:
echo("$array[$i]["c
Thanks to all the replies to my previous email on arrays (passing arrays through URLs)
but I cannot seem to get serialize() to work correctly so I'm now trying to echo out
the array as a series of hidden elements in a form that when submitted will re-build
the array.
I've been driving myself ma
On Friday 09 February 2001 11:58, Jørg V. Bryne wrote:
> i would agree that serialize isn't good for huge arrays, yes, but if
> you're considering databases, why not use sessions?
Well, if sessions are useful for you, go ahead and use them. If you only
want to pass something on 1-5 links on your
i would agree that serialize isn't good for huge arrays, yes, but if you're
considering databases, why not use sessions?
-J
- Original Message -
From: "Christian Reiniger" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, February 0
On Friday 09 February 2001 10:31, Jørg V. Bryne wrote:
> check out: serialize();
> > I'm trying to pass a multi dimensional array through a url link but
> > I'm having a hard time doing this. Is it actually possible? from what
It's possible (with serialize), but not desirable if the array can be
check out: serialize();
- Original Message -
From: "Jamie" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, February 09, 2001 10:28 AM
Subject: [PHP] Arrays through URL
> I'm trying to pass a multi dimensional array through a url
I'm trying to pass a multi dimensional array through a url link but I'm
having a hard time doing this. Is it actually possible? from what I can tell
the url just shows ...$form_options_array=Array
Is there a better way to do this?
thanks
jamie
--
PHP General Mailing List (http://www.php
"Jamie" <[EMAIL PROTECTED]> wrote:
> $results = mysql_query("SELECT option_type, code FROM options WHERE
> code='000' ORDER BY option_type",$db);
> mysql_fetch_array($results);
> // From what understand I should have an array some thig like this:
> // ("Size"=>"A4" , "Size" => "A3", "Size"=>"A5"
Can someone please help me with this code I'm having major problems with
arrays. This code is part of a function I'm writing to deal with an array
returned from a HTML form of check boxes so if anyone has an example of this
sort of thing I'd appreciate a look at it. Anyway Code follows :
//Readin
201 - 274 of 274 matches
Mail list logo