Can arrays be passed to functions just like a simple variable?
Yes.
Can arrays be passed as values in hidden form fields just like a
simple variable?
Yes, with a little work.
I've been playing around with these and getting inconsistent
results. I've been trying things like serialize
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
Try:
input type=text name=product[]
?
foreach ($product as $p) {
print $p;
}
?
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
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 I tried
Your code looks fine. Are you sure you haven't edited away significant
parts of it when posting to the list? Maybe a input name=product
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
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: input type=checkbox name=foo checked.)
3) The value of a checked checkbox is on. If a
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
»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:
: [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,apcs[0] = .
$this-apcs[0],$this-black);
Alexander Skwar
»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
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. Now I'm feeling dumb... It does
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.
On Wed, 24 Apr 2002, Liam MacKenzie wrote:
Snippet of PHP
while ( $element = each( $games ) )
{
echo $element[value];
echo br;
}
/Snippet of PHP
I tried this too, it gave the same results as the above...
if (is_array($games)) {
for ($z=0;$zcount($games);$z++) {
echo
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:
?php
class
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
,
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've created a class to hold data so
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 problem is that you refer to $test-words. You
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
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 problem is
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
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)
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 =
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
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:
form method=post action=$php_self
input type=radio name=FORM_ITEM value=TextHere,5
input type=radio
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 php writing abilities
?
List($text,$number)=explode(|,$FORM_ITEM);
?
form method=post action=? echo $php_self; ?
input type=radio name=FORM_ITEM value=TextHere|5
input type=radio name=FORM_ITEM value=OtherText|10
/form
Op woensdag 13 februari 2002 23:04, schreef Police Trainee:
good evening gentlemen. I am
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)];
}
return
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;
$length = 26;
for($i=0; $i $length; $i++) {
$key .= $pool[mt_rand(0,strlen($pool)-1)];
}
return $key;
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
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
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
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 an xml
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
easyeasy/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 does=1
You forgot the printf method
printf(Some text %sBR\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] Arrays/Hashes
I've
Hey there,
sortta simple question... Is it just me or can't you access hashes within
strings?
This works...
print(Some text $myarray[0]BR\n);
This doesn't
print(Some text $myhash['mykey']BR\n);
i'm asking in relation to databases (not that that matters). If i fetch a row
from the database I
I've noticed this, too. There are at least two things you can do to
make them work...
print(Some text {$myhash['mykey']}BR\n)
or
print(Some text .$myhash['mykey'].BR\n)
jim
Hey there,
sortta simple question... Is it just me or can't you access hashes within
strings?
This works...
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
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(*)
Hey guys,
Im have a couple of form elements with the names of php arrays. Instead of
just using input type=text name=myArray[], 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
[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 using input type=text name=myArray[], Im
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 variable and #
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)
Once I
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 variable and # is an
Brad Hubbard wrote:
?php
// Suck 'em in
$site = array (
section1 = 007,
section2 = 11,
section3 = 57.5,
section4 = 12,
section10 = 1
);
Okay, this answer the first part of my
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 = ($section
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
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,
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 |
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
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... :)
_
.
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
Hi, I have a multi-select listbox set up like this:
Author (you are able to select more than one.a href=addauthor.phpClick
here to add a new author/a)br:
select name=author multiple size=5
?php
$result = mysql_query(SELECT AUTHOR_ID, AUTHOR_FNAME, AUTHOR_LNAME FROM
AUTHORS;) or
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
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 stored
Whats is the difference between [] and {} ?
define(NL,br\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 difference
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
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
To: [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 ARGS
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
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:
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 array
I am
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
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
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 link but I'm
havi
On Friday 09 February 2001 10:31, Jrg 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 become
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 09, 2001 11:32 AM
Subje
On Friday 09 February 2001 11:58, Jrg 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
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 :
"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",
201 - 270 of 270 matches
Mail list logo