What wrong with this code? i am tryin to create an array from the while loop, but i
only get one value :(
while($rowmenu = mysql_fetch_array($resultmenu)){
while (list($k, $v) = each ($rowmenu)) {
$val[$k] = $v;
}
}
Basically the $rowmenu returns more than one records.. and i want
while (list($k, $v) = each ($rowmenu)) {
$val[] = $v;
}
}
try that
-Original Message-
From: Awlad Hussain [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2003 8:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Array
What wrong with this code? i am tryin to create an array from
Hello,
I have a mysql statement listed below. The table contains about 100
rows of information. Only one row matches the $criteria. Can anyone
tell me why the count($myrow) is 8? Shouldn't it be 4 (id, vanNumber,
origin, destination)?
$criteria = 02-25-2003;
$result = mysql_query(SELECT id,
- Original Message -
From: Guru Geek [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, May 30, 2003 3:15 PM
Subject: [PHP] array count() oddity
Hello,
I have a mysql statement listed below. The table contains about 100
rows of information. Only one row matches the $criteria
I'm new to working with complex arrays/objects and need a little help.
Below is the array I need to convert to a different type of array. The
begin what i have section is data I've succesfully mined from an XML file.
The data labeled desired output is how I need the data to be formatted.
How do I
At 01:38 30.05.2003, John Wulff said:
[snip]
I'm new to working with complex arrays/objects and need a little help.
Below is the array I need to convert to a different type of array. The
begin what i have section is data I've succesfully mined from an XML
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
Hi
I have an PHP array and want to send it into another PHP site.
$arr =
array(251,1,23,54,15,135,1651,156,13,123,321,123,32,54,654,456,32,1);
?
script language=JavaScript type=text/javascript
a href=\javascript: void(vindu2 =
window.open('view.php?arr=?$arr;?','windowname
:
Hi
I have an PHP array and want to send it into another PHP site.
$arr =
array(251,1,23,54,15,135,1651,156,13,123,321,123,32,54,654,456,32,1);
?
script language=JavaScript type=text/javascript
a href=\javascript: void(vindu2 =
window.open('view.php?arr=?$arr;?','windowname','toolbar
At 11:21 25.03.2003, Justin French said:
[snip]
1. Missing an equal sign: ?=$ not ?$
window.open('view.php?arr=?=$arr;?','windo...
2. Check out serialize()
http://www.php.net/manual/en/function.serialize.php
Hi,
say I have two arrays: X and Y. How can i get the values I X that arent in Y
and assign them to another array?
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
www.php.net/array_diff
shaun wrote:
Hi,
say I have two arrays: X and Y. How can i get the values I X that arent in Y
and assign them to another array?
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi all,
I'm making a bulk send mail program script.
In this script I use an array:
now this works fine: $send_vars = array(
'recipients' = array('[EMAIL
PROTECTED]','[EMAIL PROTECTED]','[EMAIL PROTECTED]')
I need to create a form where work/home address details need to be entered.
I'd like to have these listed as 2 entries in the mysql db so I'm assuming I
need to create an array and loop through the array to do the insert.
So I have an address[1] and address[2] for example for a total of 12
At 20:59 22.03.2003, Jason Dulberg said:
[snip]
My problem is that I'm not sure how to set up the array for the fields and
how to take the input fields and insert them. Do I need a multidimensional
array for this?
ie.
input type=text name=address[address][]
suggested as well.
Thanks again!
Jason
-Original Message-
From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]
Sent: March 22, 2003 4:05 PM
To: Jason Dulberg
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] array insert help
At 20:59 22.03.2003, Jason Dulberg said:
[snip
At 22:24 22.03.2003, Jason Dulberg said:
[snip]
Thanks for your help...
I tried the code as you suggested however when I attempted to echo the
variables for testing but nothing showed.
for($i = 0; $i = 1; ++$i) {
echo
Hi all,
I'm making a bulk send mail program script.
In this script I use an array:
now this works fine: $send_vars = array(
'recipients' = array('[EMAIL
PROTECTED]','[EMAIL PROTECTED]','[EMAIL PROTECTED]')
I want to do the following:
$u=preg_replace(/[^$chars]/e,'%.unpack(H2, $0)', $u);
However, as you know, unpack returns an array. I tried this instead:
$u=preg_replace(/[^$chars]/e,'%.(unpack(H2, $0)[])', $u);
but that isn't syntactically correct. I know that this is possible to
remedy using
I want to do the following:
$u=preg_replace(/[^$chars]/e,'%.unpack(H2, $0)', $u);
However, as you know, unpack returns an array. I tried this instead:
$u=preg_replace(/[^$chars]/e,'%.(unpack(H2, $0)[])', $u);
but that isn't syntactically correct. I know that this is possible to
remedy
maybe implode?
$u=preg_replace(/[^$chars]/e,%.implode('',unpack(H2, $0)), $u);
adrian porter wrote:
I want to do the following:
$u=preg_replace(/[^$chars]/e,'%.unpack(H2, $0)', $u);
However, as you know, unpack returns an array. I tried this instead:
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
New at this, somewhat:
?php
#http://www.php.net/manual/en/ref.array.php
$EricCodesArray = array (
CO = Description, Input Name, Select Name, Option Name, Option
Selected,
AN = ERIC Number, EricAN, SelAN, AN, AN «Annotation»,
TI = Title, EricTI, SelTI, BT, BT «Book Title»
);
echo
would this work ?
$EricCodesArray[2][2] ?
= Original Message From [EMAIL PROTECTED] =
New at this, somewhat:
?php
#http://www.php.net/manual/en/ref.array.php
$EricCodesArray = array (
CO = Description, Input Name, Select Name, Option Name,
Option Selected,
AN = ERIC Number,
echo $EricCodesArray[2][2];
No.
would this work ?
$EricCodesArray[2][2] ?
?php
#http://www.php.net/manual/en/ref.array.php
$EricCodesArray = array (
CO = Description, Input Name, Select Name, Option Name,
Option Selected,
AN = ERIC Number, EricAN, SelAN, AN, AN «Annotation»,
echo $EricCodesArray[2][2];
No. Sorry. Empty set.
I would also like to express it something like:
select EricCodesArray where TI displays [2]
I want to pass TI into a function and build some html for that record.
Pseudo code:
echo (PTI[0] input name=TI[1] select name=TI[2]option
-
From: John Taylor-Johnston [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 08, 2003 4:47 PM
Subject: [PHP] Array - Newbie question
New at this, somewhat:
?php
#http://www.php.net/manual/en/ref.array.php
$EricCodesArray = array (
CO = Description, Input Name, Select Name
You need to have this
$EricCodesArray = array (
CO = array(Description,
Input Name,
Select Name,
Option Name,
At 01:47 09.03.2003, John Taylor-Johnston said:
[snip]
New at this, somewhat:
?php
#http://www.php.net/manual/en/ref.array.php
$EricCodesArray = array (
CO = Description, Input Name, Select Name, Option Name,
Option Selected,
AN = ERIC Number,
sorry yeh its not a numbered key as like the next posts $EricCodesArray[TI][2]
= Original Message From [EMAIL PROTECTED] =
echo $EricCodesArray[2][2];
No.
would this work ?
$EricCodesArray[2][2] ?
?php
#http://www.php.net/manual/en/ref.array.php
$EricCodesArray = array (
CO =
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
David Otton [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 22 Feb 2003 03:28:22 -, you wrote:
Let's say I need to take one of 20 actions depending on a form selection.
I
could use a switch statement with 20 cases, but I could also do something
like:
// Pretend this comes
Let's say I need to take one of 20 actions depending on a form selection. I
could use a switch statement with 20 cases, but I could also do something
like:
// Pretend this comes from a form
$formchoice = mars;
$response = array(
mars = go_mars(),
mercury = go_mercury(),
earth =
Chris, et al --
...and then Chris said...
%
% Let's say I need to take one of 20 actions depending on a form selection. I
% could use a switch statement with 20 cases, but I could also do something
% like:
%
% // Pretend this comes from a form
% $formchoice = mars;
%
%
% $response = array(
On 22 Feb 2003 03:28:22 -, you wrote:
Let's say I need to take one of 20 actions depending on a form selection. I
could use a switch statement with 20 cases, but I could also do something
like:
// Pretend this comes from a form
$formchoice = mars;
$response = array(
mars = go_mars(),
Let's say I need to take one of 20 actions depending on a form
selection.
I
could use a switch statement with 20 cases, but I could also do
something
like:
// Pretend this comes from a form
$formchoice = mars;
$response = array(
mars = go_mars(),
mercury = go_mercury(),
earth =
In a message dated 2/19/2003 8:44:53 PM Pacific Standard Time,
[EMAIL PROTECTED] writes:
I have a problem here in array manipulations. I need an output like this
from the queried data :
data1,data2,data3
Any idea how? thanx in advance
$string = ''.implode(',',$testarray).'';
Janet
At 22:56 18.02.2003, Joachim Krebs spoke out and said:
[snip]
Is there any speed difference at all from the following two code
blocks (miniscule or not)? If so, which is faster?
$cfg[db][host] = ;
$cfg[db][user] = ;
$cfg[db][pass] = ;
or
hi to all
I have a problem here in array manipulations. I need an output like this
from the queried data :
data1,data2,data3
Any idea how? thanx in advance
mike
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Message -
From: Chris Cook [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 20, 2003 12:42 PM
Subject: Re: [PHP] array values format
Hi Michael,
Something like this should work:
for($i=0; $isizeof($array); $i++)
{
$data .= $array[$i] . , ;
}
preg_replace
On Thursday 20 February 2003 13:36, Michael P. Carel wrote:
as per testing it doesnt delete the last comma, i'm doing something like
this:
for($i=0;$isizeof($images);$i++)
{
$pictures .=\./archive/bannerimages/.$bid[$i]./.$images[$i].\.,;
}
preg_replace(/,$/,,$pictures);
echo $pictures;
thanks it working now
- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 20, 2003 2:40 PM
Subject: Re: [PHP] array values format
On Thursday 20 February 2003 13:36, Michael P. Carel wrote:
as per testing it doesnt delete the last
At 08:45 18.02.2003, Chris Blake said:
[snip]
// THIS IS LINE 27
//print them out to page
echo $row['ClientID'].['ClientName'].['Distance']. 'hr';
[snip]
Try
echo
Is there any speed difference at all from the following two code
blocks (miniscule or not)? If so, which is faster?
$cfg[db][host] = ;
$cfg[db][user] = ;
$cfg[db][pass] = ;
or
$cfg[db] = array(host=, user=, pass=);
Joachim
--
PHP General Mailing List
Greetings all,
My database has one table with three fields i.e. ClientID, ClientName
and Distance .
I`m trying to get all the field data printed to a form but whenever I
try to add the ClientID and Distance fields to the code below it
bombs out with the following error :
Parse error: parse
My question is if anyone have any idé on how to sort this array so that the
names and ages are sorted after Close Friend, Friend, Wife and last
Family...
$A[] = array (Nils, 23, Friend);
$A[] = array (Emma, 21, Friend);
$A[] = array (Cassie, 21, Wife);
$A[] = array (Zydox, 23, Friend);
$A[] =
You can use in_array (http://www.php.net/function.in_array) for this.
--
Mattias
--|-Original Message-
--|From: Narciso Miguel Rodrigues
--|[mailto:[EMAIL PROTECTED]]
--|Sent: Wednesday, February 05, 2003 02:03
--|To: [EMAIL PROTECTED]
--|Subject: [PHP] Array find a element
Is possible to do something like
if ($username in $users) ... or i need to do a foreach($user){...}
Thks
[MsR]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Is possible to do something like
if ($username in $users) ... or i need to do a foreach($user){...}
www.php.net/in_array
www.php.net/array_search
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--
PHP General
hi..
i have an array (not written in code yet) but it is from a multiple select
listbox and i want to use the elements in the array in an insert query.. and
dont know how that works...
(i wont know how many elements there will be on the insert)..the array
elements will need to be put in 1 field
- Original Message -
From: Sunfire [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 03, 2003 1:15 PM
Subject: [PHP] array of unknown elements and insert query
hi..
i have an array (not written in code yet) but it is from a multiple select
listbox and i want to use the elements
advice you somethig better
Good luck
Greetings
Enediel
Linux user 300141
Happy who can penetrate the secret causes of the things
¡Use Linux!
- Original Message -
From: Sunfire [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 03, 2003 12:15 PM
Subject: [PHP] array of unknown
can someone give me a bit of help / walthrough the following for me !
this first bits is okay
$mysql query1
result
array[cityid][cityname]
mysql query2
result
array[cityid][cityname]
now what i want to do is kick out any doubles in my array and resort them
alphebetically by cityname ?!
help !
John, et al --
...and then John Fishworld said...
%
% can someone give me a bit of help / walthrough the following for me !
Let's see if I can help.
% this first bits is okay
% $mysql query1
% result
% array[cityid][cityname]
%
% mysql query2
% result
% array[cityid][cityname]
Are CityIDs
$mysql query1
result
array[cityid][cityname]
mysql query2
result
array[cityid][cityname]
now what i want to do is kick out any doubles in my array
and resort them alphebetically by cityname ?!
It's difficult to answer this question without knowing more about the
context and
% different ways of connecting tables with LEFT JOIN. USING( fieldname )
% connects the table being joined, with the table listed right before it,
% using the same fieldname in both. The ON syntax allows you to use
% differently named fields, and/or a different table.
I still don't get what
At 06:32 AM 1/1/03 -0500, David T-G wrote:
I still don't get what a left or right or outer or inner join is...
The reason I chose LEFT JOIN are:
o You get better control over how the query is executed.
o Values from the first table are returned even if there is no associated
entry in the
Rick, et al --
...and then Rick Widmer said...
%
% At 02:57 PM 12/31/02 -0500, David T-G wrote:
% ...and then Tularis said...
% %
% % Usually,
% % using mysql to handle your tables is *way* faster than letting php
% % handle it.
%
% Yes, do as much as you can in the database. The people who
Hi, all --
I'm so far about knee-deep in my project where I'll be using php to talk
to the mysql database and spit out my web pages. I wonder if I should be
making individual calls to the database or loading a table into an array
so that I can walk it without those calls.
For instance, I have
Usually,
using mysql to handle your tables is *way* faster than letting php
handle it.
That's what it was made for, speed...!
In your case, you could just do a complex join I think. That would give
all results in one table, and you could just order that on scheduletime,
and voila, you'd
Tularis, et al --
...and then Tularis said...
%
% Usually,
% using mysql to handle your tables is *way* faster than letting php
% handle it.
Hmmm... OK. But that's so many queries... Or is it?, he asks,
reading farther.
%
% That's what it was made for, speed...!
Well, yeah, I figured
Tularis, et al --
...and then David T-G said...
%
% ...and then Tularis said...
% %
% % Usually,
% % using mysql to handle your tables is *way* faster than letting php
% % handle it.
...
% %
% % In your case, you could just do a complex join I think. That would give
%
% Ahhh... A new term.
At 02:57 PM 12/31/02 -0500, David T-G wrote:
...and then Tularis said...
%
% Usually,
% using mysql to handle your tables is *way* faster than letting php
% handle it.
Yes, do as much as you can in the database. The people who wrote it spent
a lot of time trying to optimize it.
%
% In your
I have an array I set up like this:
$monthschedule = array(1 = Jan, 2 = Feb, 3 =
Mar, 6 = Jun);
When I try to access them, doing this:
$r = $monthschedule[6];
nothing comes up ($r is blank). Any thoughts? There
are missing elements (4,5,7-12) in $monthschedule.
On Tuesday 17 December 2002 01:43, Mako Shark wrote:
I have an array I set up like this:
$monthschedule = array(1 = Jan, 2 = Feb, 3 =
Mar, 6 = Jun);
When I try to access them, doing this:
$r = $monthschedule[6];
nothing comes up ($r is blank). Any thoughts? There
are missing elements
What you have to do, at least I think, is you have to type:
$r = $monthschedule[Jun];
That is what I think you have to do. The other way you did it was when you
have a value-only array.
On Mon, 16 Dec 2002, Mako Shark wrote:
I have an array I set up like this:
$monthschedule = array(1 =
))
{
$c = $cell['value'];
$k = $cell['key'];
print (Key: $k; Value: $cBR);
}
}
Quentin
-Original Message-
From: Andy Turegano [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 17 December 2002 10:25 a.m.
To: Mako Shark
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Array
What you have
PROTECTED]]
Sent: Tuesday, 17 December 2002 10:25 a.m.
To: Mako Shark
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Array
What you have to do, at least I think, is you have to type:
$r = $monthschedule[Jun];
That is what I think you have to do. The other way you did it was when you
have a value
]
Subject: Re: [PHP] Array
What you have to do, at least I think, is you have to type:
$r = $monthschedule[Jun];
That is what I think you have to do. The other way you did it was when you
have a value-only array.
On Mon, 16 Dec 2002, Mako Shark wrote:
I have an array I set up
hello everyone,
I'm trying to get some images value from a checkbox putting them in a session to
preserve the data. The array works perfectly without the session_start() and
session_register.
can anyone help?
html script
html
head
title/title
/head
body
form action=submit_information.php
Are you on PHP = 4.1 ?
Try this:
?
session_start();
print_r($_POST['Image']); // should print out your
//checkbox array
$_SESSION['Image'] = $_POST['Image']; // instead of session register
print_r($_SESSION['Image']);// should
if all you might have there is 'error', try
if(array_search('error',$array) === FALSE) {
echo 'not ok';
}
if you might have different strings, do
$result='ok';
foreach($array as $v) {
if($v) {
$result ='not ok';
break;
}
}
Mattia wrote:
Can anyone suggest an ELEGANT way
Wow this was really elegant!! thank you!! :-)
if (0 strlen(implode('',$a))) {
// error
}
Stas
-
Per te Blu American Express è gratis
Can anyone suggest an ELEGANT way to find out if an array is made of empty
strings or not?
example
$a = Array( '' , '' , '' ); //ok
$b = Array( '' , '' , 'error' ); // not ok
$c = Array( 'error' , '' , 'error' ); // not ok
tia
Mattia
--
PHP General Mailing List (http://www.php.net/)
To
Mattia,
Can anyone suggest an ELEGANT way to find out if an array is made of empty
strings or not?
example
$a = Array( '' , '' , '' ); //ok
$b = Array( '' , '' , 'error' ); // not ok
$c = Array( 'error' , '' , 'error' ); // not ok
implode() then check for nullstring/count characters.
Hi,
i have an array like:
Array
(
[1] = Array
(
[alias] = foo
...
)
[2] = Array
(
[alias] = bar
...
)
...
)
I need some way to find out, if an alias foo is in the array. Any idea how
to do this?
Thanks,
Hi people,
is there a way to retrieve an array from a function ?
like:
?php
test_func($param1, $param2) {
//code
$test = array (ASD = Test1, ASDF = Test2);
return $test;
}
//outiside de function
echo $test; // - the array
?
This doesn't work. So, any clue ?
Regards and tks
Try this...
$test_arr = test_func( $param1, $param2 )
echo $test_arr;
On Tue, 2002-11-05 at 18:01, Francisco Vaucher wrote:
Hi people,
is there a way to retrieve an array from a function ?
like:
?php
test_func($param1, $param2) {
//code
$test = array (ASD = Test1, ASDF
hi,
this one worked well, but to print the array you must use print_r() instead
of echo
print_r($test);
khalid
_
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
Ugh. Read the in the manual about variable scope, and how to call a
function. It's all there. To get you started...
print_r ( test_func() );
Francisco Vaucher wrote:
Hi people,
is there a way to retrieve an array from a function ?
like:
?php
test_func($param1, $param2) {
//code
sorry ... big said the right, but you must use print_r() if you want to
print the array
_
Internet access plans that fit your lifestyle -- join MSN.
http://resourcecenter.msn.com/access/plans/default.asp
--
PHP General Mailing
Part of the ugh thing is because I'm having a crappy day. However,
the main part of the ugh thing is because of people not doing any
research before posting a question here. It has nothing to do with my
wanting to answer the question or not, I enjoy helping out here, and I
have gotten
mailto:fvaucher;tycoint.com
-Mensaje original-
De: John Nichel [mailto:jnichel;by-tor.com]
Enviado el: martes, 05 de noviembre de 2002 15:20
Para: Francisco Vaucher
CC: [EMAIL PROTECTED]
Asunto: Re: [PHP] array()
Part of the ugh thing is because I'm having a crappy day. However
mailto:fvaucher;tycoint.com
-Mensaje original-
De: John Nichel [mailto:jnichel;by-tor.com]
Enviado el: martes, 05 de noviembre de 2002 15:20
Para: Francisco Vaucher
CC: [EMAIL PROTECTED]
Asunto: Re: [PHP] array()
Part of the ugh thing is because I'm having a crappy day. However
I have two arrays and I have complete list of numbers in one of them,
lets call it $complete[]
and another that has some values of the complete one, lets call that one
$part[], now if I want to
return an array with all the values that are in $complete[] but not in
$part[], how would I do that?
On Friday 01 November 2002 19:22, Davíð Örn Jóhannsson wrote:
I have two arrays and I have complete list of numbers in one of them,
lets call it $complete[]
and another that has some values of the complete one, lets call that one
$part[], now if I want to
return an array with all the values
801 - 900 of 1246 matches
Mail list logo