Jim Lucas has it. You can use the preg_match function to find it. I would
use regexp for that reason. regexp is good for making sure things are typed
the way they need to (mostly used for).
Ravi.
On Sat, Dec 18, 2010 at 5:17 PM, Jim Lucas li...@cmsws.com wrote:
On 12/17/2010 12:52 PM, Sorin
On 12/17/2010 12:52 PM, Sorin Buturugeanu wrote:
Hello all!
I have a question regarding arrays and the way I can use a value.
Let's say I have this string:
$s = 'banana,apple,mellon,grape,nut,orange'
I want to explode it, and get the third value. For this I would normally do:
$a =
Hello all!
I have a question regarding arrays and the way I can use a value.
Let's say I have this string:
$s = 'banana,apple,mellon,grape,nut,orange'
I want to explode it, and get the third value. For this I would normally do:
$a = explode(',', $s);
echo $s[2];
That's all fine, but is there
[snip]
I have a question regarding arrays and the way I can use a value.
Let's say I have this string:
$s = 'banana,apple,mellon,grape,nut,orange'
I want to explode it, and get the third value. For this I would normally
do:
$a = explode(',', $s);
echo $s[2];
That's all fine, but is there a
On Fri, Dec 17, 2010 at 15:52, Sorin Buturugeanu m...@soin.ro wrote:
Hello all!
I have a question regarding arrays and the way I can use a value.
Let's say I have this string:
$s = 'banana,apple,mellon,grape,nut,orange'
I want to explode it, and get the third value. For this I would
Tanks for all of your responses!
I guess a function is the way to go. I just have to see if the situation
comes up enough times to justify the function approach.
@Dan: I really enjoyed your disclaimer :D
--
Sorin Buturugeanu
www.soin.ro
http://www.facebook.com/buturugeanu
was explicitly created, php
made the next one at 3.
Thanks,
Ash
http://www.ashleysheridan.co.uk
- Reply message -
From: chris h chris...@gmail.com
Date: Sat, Sep 25, 2010 22:05
Subject: [PHP] Array question
To: MikeB mpbr...@gmail.com
Cc: php-general@lists.php.net
Mike,
$results
At 3:31 PM -0500 9/25/10, MikeB wrote:
-snip-
My question, in the loop, why does tha author use:
$results[] = mysql_fetch_array($result);
instead of (as I would expect):
$results[$j] = mysql_fetch_array($result);?
What PHP magic is at work here?
Mike:
That's just a shorthand way to
I have the following code:
$query = SELECT * FROM classics;
$result = mysql_query($query);
if (!$result) die (Database access failed: . mysql_error());
$rows = mysql_num_rows($result);
for ($j = 0 ; $j $rows ; ++$j)
{
$results[] = mysql_fetch_array($result);
}
mysql_close($db_server);
Mike,
$results[] will automatically push a value unto the end of an array.
So doing this...
--
$magic = array();
$magic[] = 'a';
$magic[] = 'b';
$magic[] = 'c';
-
is exactly this same as doing this...
--
$normal = array();
$normal[0] = 'a';
$normal[1] = 'b';
$normal[2] = 'c';
-
Thanks for all the input. You've all been pretty informative. Sorry of
delayed response to help but was busy. You all are appreciated.
Stut [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Richard Lynch wrote:
On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote:
But I'd have to
On Sat, 2007-07-14 at 00:55 -0500, Richard Lynch wrote:
On Fri, July 13, 2007 2:15 am, Richard Lynch wrote:
On Thu, July 12, 2007 8:29 am, Robert Cummings wrote:
Hmmm, I thought using an explicit cast was very self explanatory --
especially when the name of the cast is array. Maybe I'm
On Thu, July 12, 2007 8:29 am, Robert Cummings wrote:
Hmmm, I thought using an explicit cast was very self explanatory --
especially when the name of the cast is array. Maybe I'm alone in
that
thought. I mean if you convert a scalar to an array what do you expect
to get? An array with the
On Fri, 2007-07-13 at 02:15 -0500, Richard Lynch wrote:
On Thu, July 12, 2007 8:29 am, Robert Cummings wrote:
Hmmm, I thought using an explicit cast was very self explanatory --
especially when the name of the cast is array. Maybe I'm alone in
that
thought. I mean if you convert a scalar
On Fri, July 13, 2007 2:15 am, Richard Lynch wrote:
On Thu, July 12, 2007 8:29 am, Robert Cummings wrote:
Hmmm, I thought using an explicit cast was very self explanatory --
especially when the name of the cast is array. Maybe I'm alone in
that
thought. I mean if you convert a scalar to an
Richard Lynch wrote:
On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote:
But I'd have to say that the intent is not all that clear, really,
and
I'd be leery of this feature, personally.
I wouldn't be leery at all. It's been around for a very long time and
it's documented:
On Thu, 2007-07-12 at 09:58 +0100, Stut wrote:
Richard Lynch wrote:
On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote:
But I'd have to say that the intent is not all that clear, really,
and
I'd be leery of this feature, personally.
I wouldn't be leery at all. It's been around for a
Is there a php function similar to in_array that can detect if a partial
value is in an array value or not:
e.g.
$var1 = big horse;$var2 = small yellow;$var3 = red hydrant;
$theArray = array(big blue horse, small yellow bird, giant red hydrant);
Is there a way to find out if $var1
On 11/07/07, kvigor [EMAIL PROTECTED] wrote:
Is there a php function similar to in_array that can detect if a partial
value is in an array value or not:
e.g.
$var1 = big horse;$var2 = small yellow;$var3 = red hydrant;
$theArray = array(big blue horse, small yellow bird, giant red
Thanks,
I've seen the light by your code.
Robin Vickery [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 11/07/07, kvigor [EMAIL PROTECTED] wrote:
Is there a php function similar to in_array that can detect if a partial
value is in an array value or not:
e.g.
$var1 = big
On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote:
On 11/07/07, kvigor [EMAIL PROTECTED] wrote:
Is there a php function similar to in_array that can detect if a partial
value is in an array value or not:
e.g.
$var1 = big horse;$var2 = small yellow;$var3 = red hydrant;
Robert Cummings wrote:
On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote:
On 11/07/07, kvigor [EMAIL PROTECTED] wrote:
Is there a php function similar to in_array that can detect if a partial
value is in an array value or not:
e.g.
$var1 = big horse;$var2 = small yellow;$var3
On Wed, 2007-07-11 at 15:52 +0100, Stut wrote:
Robert Cummings wrote:
On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote:
On 11/07/07, kvigor [EMAIL PROTECTED] wrote:
Is there a php function similar to in_array that can detect if a partial
value is in an array value or not:
e.g.
Robert Cummings wrote:
On Wed, 2007-07-11 at 15:52 +0100, Stut wrote:
Robert Cummings wrote:
On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote:
On 11/07/07, kvigor [EMAIL PROTECTED] wrote:
Is there a php function similar to in_array that can detect if a partial
value is in an array
On Wed, 2007-07-11 at 16:07 +0100, Stut wrote:
Robert Cummings wrote:
On Wed, 2007-07-11 at 15:52 +0100, Stut wrote:
Robert Cummings wrote:
On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote:
On 11/07/07, kvigor [EMAIL PROTECTED] wrote:
Is there a php function similar to in_array
On 11/07/07, Robert Cummings [EMAIL PROTECTED] wrote:
On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote:
On 11/07/07, kvigor [EMAIL PROTECTED] wrote:
Is there a php function similar to in_array that can detect if a partial
value is in an array value or not:
e.g.
$var1 = big
On Wed, July 11, 2007 9:52 am, Stut wrote:
$needle = (array)$needle;
Conversion to array creates an array with one element... the value
converted.
Without raising a notice?
Sure looks like it:
php -d error_reporting=2047 -r '$foo = (array) foo; var_dump($foo);'
array(1) {
[0]=
On Wed, 2007-07-11 at 16:11 -0500, Richard Lynch wrote:
On Wed, July 11, 2007 9:52 am, Stut wrote:
$needle = (array)$needle;
Conversion to array creates an array with one element... the value
converted.
Without raising a notice?
Sure looks like it:
php -d error_reporting=2047
On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote:
But I'd have to say that the intent is not all that clear, really,
and
I'd be leery of this feature, personally.
I wouldn't be leery at all. It's been around for a very long time and
it's documented:
On Wed, 2007-07-11 at 16:40 -0500, Richard Lynch wrote:
On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote:
But I'd have to say that the intent is not all that clear, really,
and
I'd be leery of this feature, personally.
I wouldn't be leery at all. It's been around for a very long
[EMAIL PROTECTED] wrote:
$count=count($data-legs-leg);
$k=0;
while($k $count)
{
Hi All
I am having a bit of trouble with PHP arrays and would appreciate some help.
I currently have the following piece of code
$count=count($data-legs-leg);
$k=0;
while($k $count)
{
$legrow[$data-legs-leg[$k]['legId']]
?? See if that works...
Jake
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 24, 2007 11:27 PM
To: php-general@lists.php.net
Subject: [PHP] Array Question
Hi All
I am having a bit of trouble
] Array Question
Hi All
I am having a bit of trouble with PHP arrays and would
appreciate some help.
I currently have the following piece of code
$count=count($data-legs-leg);
$k=0;
while($k $count)
{
$legrow[$k]=$data-legs-leg[$k
-leg[$k]['legId']]
?? See if that works...
Jake
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 24, 2007 11:27 PM
To: php-general@lists.php.net
Subject: [PHP] Array Question
Hi All
I am having a bit of trouble with PHP arrays and would
, March 24, 2007 11:27 PM
To: php-general@lists.php.net
Subject: [PHP] Array Question
Hi All
I am having a bit of trouble with PHP arrays and would
appreciate some help.
I currently have the following piece of code
$count=count($data-legs-leg);
$k=0;
while($k $count
What is the result your getting?
Jake
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 24, 2007 11:57 PM
To: Jake McHenry
Cc: php-general@lists.php.net
Subject: RE: [PHP] Array Question
Hi Jake
I tried that and got the same result
PROTECTED]
Sent: Saturday, March 24, 2007 11:27 PM
To: php-general@lists.php.net
Subject: [PHP] Array Question
Hi All
I am having a bit of trouble with PHP arrays and would
appreciate some help.
I currently have the following piece of code
$count=count($data-legs-leg);
$k=0
:09 AM
To: Jake McHenry
Cc: php-general@lists.php.net
Subject: RE: [PHP] Array Question
Hi Jake
I am getting nothing at all.
Regards
Richard
What is the result your getting?
Jake
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent
On 27 February 2007 04:23, Gerry D wrote:
I have a question on how to retrieve the value that corresponds to a
key in an array.
$fruit = array('a' = 'apple', 'b' = 'banana', 'c' = 'cranberry');
$key = array_search($c, $fruit);
if ( $key === FALSE )
Mike,
See entire function under topic Array question - maybe UTF?...
I am trying to change accented characters to their equivalent without accents.
And yes, the arrays look fine after var_dump()...
Gerry
On 2/27/07, Ford, Mike [EMAIL PROTECTED] wrote:
On 27 February 2007 04:23, Gerry D
I have a question on how to retrieve the value that corresponds to a
key in an array.
$fruit = array('a' = 'apple', 'b' = 'banana', 'c' = 'cranberry');
$key = array_search($c, $fruit);
if ( $key === FALSE )
$n = $c;
else
So, I have an array that looks like this
rray(3) {
[0]=
array(8) {
[line]=
string(1) 1
[ponbr]=
string(5) 34474
[emt]=
string(3) yes
[qty]=
string(1) 5
[price]=
string(2) 19
[shipdate]=
string(8) 11/06/07
[tracking]=
string(17)
Let me try this again. I want to take an array that may look like this
array(2) {
[0]=
array(8) {
[line]=
string(1) 1
[ponbr]=
string(5) TEST1
[emt]=
string(3) yes
[qty]=
string(1) 5
[price]=
string(2) 19
[shipdate]=
string(8) 12/04/06
hey, thanks for jogging my memory about the array_keys ; that was exactly
what i wanted,
now I don't have to run the program through the more program now, and i
got all the names of the arrays in the big array without having half of
the info scrolling off the screen.
thanks
matt
--
PHP
I have an array with image names like:
$arrayone = array(1.jpg, 2.jpg);
$arraytwo = array(a.jpg, b.jpg);
Then I have a variable for each to count the number of elements:
$arrayoneElements = count($arrayone);
$arraytwoElements = count($arraytwo);
I'm using the element
What I want to do is to only show 20 pictures at a time with a Next link
and a Previous link. For the first 20 only the Next link would show and
whenever the last set would show only the Previous link would. Every other
time both would show.
Can someone point me in the right direction on
Hi,
I have a line of php that I don't really understand.
foreach($this-orders as $OrderID = $value) {
echo $OrderID.BR;
$OrderObject =$this-orders[$OrderID=$value];
echo $OrderObject-OrderID.--all the sameBR;
}
I know that $this-orders is an array of order objects.
the result i get
Victor C. wrote:
$OrderObject =$this-orders[$OrderID=$value];
This line is confusing. $OrderID=$value is either a typo or is just
plain wrong. It looks like what it's meant to say is:
$OrderObject = $this-orders[$OrderID];
But this will just set $OrderObject equal to $value, so you should
But why would the this line generate different OrderID on lines 1 and 3?
Ben Ramsey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Victor C. wrote:
$OrderObject =$this-orders[$OrderID=$value];
This line is confusing. $OrderID=$value is either a typo or is just
plain wrong. It
Ben Ramsey wrote:
Victor C. wrote:
$OrderObject =$this-orders[$OrderID=$value];
This line is confusing. $OrderID=$value is either a typo or is just
plain wrong. It looks like what it's meant to say is:
$OrderObject = $this-orders[$OrderID];
But this will just set $OrderObject equal to
I did a print_r(array_values)before calling the codes that had errors in
it.. the following content is contained in $this-orders;
Array ( [0] = order Object ( [UserObject] = user Object ( [UserID] =
E2401 [Pass] = [IsValid] = 1 [UserType] = AT [fonthtml] = [footerfile]
= resources/footer.php
Victor C. wrote:
I did a print_r(array_values)before calling the codes that had errors in
it.. the following content is contained in $this-orders;
Aaaghh. Can you give that to us in pre-formatted text, rather than
copying and pasting it from the browser. My eyes are going everywhere
trying
Hi Ben,
I tried your portion of code and find out what was wrong... Apparently I
used in adding order to the array and that was messing things up...
Everything is working now.
Thanks for all the help
Victor C. [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I did a
-Original Message-
From: Victor C. [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 02, 2004 3:06 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php array question
Hi,
I have a line of php that I don't really understand.
foreach($this-orders as $OrderID = $value) {
echo $OrderID.BR;
I
I am using the following array and function in the template for my website.
It works great, but I want to to be better. I would to make it so the last
item displayed looks differently than the others, but I have been unable to
figure out how to distinguish the last item.
When displayed, the
I would like to be able to search an array for a match the a specific
variable. So far, I have been trying to use preg_grep but am not getting
the results that I want.
Basically, I would have a variable: $url = domain.com
I would like to search an array to see if the value of the variable $url
I would like to search an array to see if the value of the variable $url
exists in this array. The array would look like:
in_array()
-
michal migurski- contact info and pgp key:
sf/ca
Good morning all!!
Can you nest an array within an array??
Example: $paArgs['aCheckBoxes[$iIndex]['sName']']
Thank you in advance.
Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
On Sat, 2003-09-27 at 12:18, Robin Kopetzky wrote:
Good morning all!!
Can you nest an array within an array??
Example: $paArgs['aCheckBoxes[$iIndex]['sName']']
You mean can you retrieve an array entry by giving a key defined by a
value in another array? To do so remove the outer quotes in
On Saturday 27 September 2003 11:18, Robin Kopetzky wrote:
Good morning all!!
Can you nest an array within an array??
Example: $paArgs['aCheckBoxes[$iIndex]['sName']']
Yes, but like this
$array['aCheckBoxes'][] = $iIndex['sName']
This means:
$array is an array
aCheckBoxes is a item in
http://www.php.net/manual/en/language.types.array.php
If you mean having an array inside an array, of course ? $arr =
array(array('data')); ?. There you have an array inside another
one, 'data' will be here $var['0']['0'].
If you meant using an array item as the key in another array,
then you do
hello everyone,
I am trying to store one of the fields of the resultset into an array
as I display the results.
while ($row = mysql_fetch_array($result1)) {
// Alternate the bgcolor of each row for visibility
($even % 2) == 0 ? $bgcolor = #EFEFEF : $bgcolor =
#ee;
Try this.
$companyname[] = $row['company'];
Jim Lucas
- Original Message -
From: Pushpinder Singh Garcha [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 28, 2003 10:16 AM
Subject: [PHP] Array Question
hello everyone,
I am trying to store one of the fields
I have a question regarding the count function. Here goes:
Lets pretend I have this array called myStuff. If I add two elements to
myStuff and call the count function, I will get a result of 2. My question
is how do I re-initialize the array after adding elements so when I call the
count function
[snip]
Lets pretend I have this array called myStuff. If I add two elements to
myStuff and call the count function, I will get a result of 2. My
question
is how do I re-initialize the array after adding elements so when I call
the
count function on the array, I get a result of 0.
[/snip]
If you
Dale Hersh mailto:[EMAIL PROTECTED]
on Thursday, July 24, 2003 12:41 PM said:
Lets pretend I have this array called myStuff. If I add two elements
to myStuff and call the count function, I will get a result of 2. My
question is how do I re-initialize the array after adding elements so
* Thus wrote Dale Hersh ([EMAIL PROTECTED]):
I have a question regarding the count function. Here goes:
Lets pretend I have this array called myStuff. If I add two elements to
myStuff and call the count function, I will get a result of 2. My question
is how do I re-initialize the array after
How do I access the data in $query_data after I go through the while loop,
here is an example
$result=mysql_query($query,$link);
while ($query_data=mysql_fetch_array($result) )
{
$var1=$query_data[var1];
$var1=$query_data[var1];
}
after the while is done, How do I access the data in
I found this in the manual user comments and it worked great
mysql_data_seek($result,0);
Randy
- Original Message -
From: Randy Johnson [EMAIL PROTECTED]
To: Brian Dunning [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 10:14 PM
Subject: [PHP] array question
How do
I have two tables that I want to display together as if they were one table
and order them by a common date field.
Because I am using MySQL I can't use the usually way I would do this. Create
a store procedure or view.
I was thinking of creating two separate queries in PHP then loading the data
look into things like JOIN and SORT BY in MySQL, they're quicker and more efficient
than PHP for doing DB stuff (so i'm told)
took me awhile to get my head around JOIN, but once you've got it, you'll never be
without it ;)
Mark McCulligh [EMAIL PROTECTED] wrote in message news:[EMAIL
At 18:58 1-4-03, you wrote:
I have two tables that I want to display together as if they were one table
and order them by a common date field.
Because I am using MySQL I can't use the usually way I would do this. Create
a store procedure or view.
Does every row in tableA has a sibling row in
I can't link the two tables at all.
I need to loop through one displaying its information, then loop through the
other table displaying its information. For if I have 5 records in table A
and 6 records in table B, I get 11 records total. Each table only has 4-5
fields and they exist in both
I have looked at the different JOINs but I can't link any fields together.
There is no relationship between the tables. The two table are basically the
same table. But the DBA didn't make them one like he should have.
Mark.
Skate [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
look
.
http://www.mysql.com/doc/en/MERGE.html
- Original Message -
From: Mark McCulligh [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 12:33 PM
Subject: Re: [PHP] Array Question
I have looked at the different JOINs but I can't link any fields
Creating an array that holds the 11 combined records from the two tables,
and sorting the array according to date: (This depends on what type your
using to store dates in MySQL, and that the exact date is unique for each
record across both tables. If the date isn't unique, it requires a little
If I sort an array, and now the keys are not in numerical order, how can I
get the key of the first element?
If I do array_shift I get the first element but I want that key.
Thanks,
Diana
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Monday 10 March 2003 21:13, Diana Castillo wrote:
If I sort an array, and now the keys are not in numerical order, how can I
get the key of the first element?
If I do array_shift I get the first element but I want that key.
Not very elegant -- there must be a better way?
foreach ($doo as
At 16:35 10.03.2003, Jason Wong said:
[snip]
Not very elegant -- there must be a better way?
foreach ($doo as $key = $value) {
print Key:$key Value:$value;
break;
}
[snip]
Possibly using array_keys()?
$keys =
-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: 10 March 2003 15:35
To: [EMAIL PROTECTED]
Subject: Re: [PHP] array question
On Monday 10 March 2003 21:13, Diana Castillo wrote:
If I sort an array, and now the keys are not in numerical
order, how can I
This is the code I am using to get the data out of the text file
below. Now I need to turn the $group[3] into an array of its own so
that I can make changes to it. How do I turn this into an array that
I can reference with $group[0]. What I need to be able to do is
search for the label in
://www.OuterBanksInternet.com
- Original Message -
From: Richard Kurth [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]
Sent: Monday, February 24, 2003 3:23 PM
Subject: [PHP] array question
This is the code I am using to get the data out of the text file
below. Now I need to turn the $group[3
Hi Guys,
This might be a bit of a newbie question, but I'm not sure how to search
for this particular information as its hard to put in search terms.
Say I have a mysql/file with information about variables. Eg, I have a
string from a mysql database of 'test'
Am I able to then, in PHP, assign
http://www.php.net/manual/en/language.variables.variable.php
Kirk
-Original Message-
From: Bob Irwin [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 3:28 PM
To: php-general
Subject: Re: [PHP] array question
Hi Guys,
This might be a bit of a newbie question
-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
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
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
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
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
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 =
[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
-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
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
--
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
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'?
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
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'),
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!
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
1 - 100 of 129 matches
Mail list logo