Returning variable and array from function
Returning variable and array from function
am 12.06.2007 12:08:00 von Gustav Wiberg
Hi there!
=20
I think I have done this before but I can't remember how I did...
=20
I want to return one variable ($htmlReport) and one array from a function
=20
=20
I'd like to like this:
return $htmlReport, $res;
but get the error: Parse error: syntax error, unexpected ',' in C:\www\test=
\timeweb\classes\reports.php on line 2745
=20
=20
=20
Best regards
/Gustav Wiberg
=20
=20
=20
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Returning variable and array from function
am 12.06.2007 12:16:58 von Dale Attree
You would need to return both as elements of an array.
-----Original Message-----
From: Gustav Wiberg [mailto:gustav@hmn.se]
Sent: 12 June 2007 12:08 PM
To: 'php windows' (php-windows@lists.php.net)
Subject: [PHP-WIN] Returning variable and array from function
Hi there!
I think I have done this before but I can't remember how I did...
I want to return one variable ($htmlReport) and one array from a function
I'd like to like this:
return $htmlReport, $res;
but get the error: Parse error: syntax error, unexpected ',' in
C:\www\test\timeweb\classes\reports.php on line 2745
Best regards
/Gustav Wiberg
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
************************************************************ ***********************************
The information contained in this e-mail is confidential and may be subject to legal privilege.
Access to this e-mail by anyone other than the intended recipient is unauthorised.
If you are not the intended recipient you must not use, copy, distribute or disclose the e-mail or any part of its contents or take any action in reliance on it. If you have received this e-mail in error, please notify us immediately by e-mail (postmaster@jacklinenterprises.com) or telephone (+27 11 265 4200).
This message is free of all known viruses. It has been screened for viruses by Blockmail.
************************************************************ ***********************************
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Returning variable and array from function
am 12.06.2007 12:17:20 von Stut
Gustav Wiberg wrote:
> I think I have done this before but I can't remember how I did...
>
> I want to return one variable ($htmlReport) and one array from a function
>
> I'd like to like this:
>
> return $htmlReport, $res;
>
> but get the error: Parse error: syntax error, unexpected ',' in C:\www\test\timeweb\classes\reports.php on line 2745
Yeah, that's not valid PHP. Return it as as array...
return array($htmlReport, $res);
-Stut
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Returning variable and array from function
am 12.06.2007 12:22:00 von Gustav Wiberg
Hi there!
Aha, ok thanx! :-)
Best regards
/Gustav Wiberg
=20
-----Original Message-----
From: Stut [mailto:stuttle@gmail.com]=20
Sent: Tuesday, June 12, 2007 12:17 PM
To: Gustav Wiberg
Cc: 'php windows' (php-windows@lists.php.net)
Subject: Re: [PHP-WIN] Returning variable and array from function
Gustav Wiberg wrote:
> I think I have done this before but I can't remember how I did...
> =20
> I want to return one variable ($htmlReport) and one array from a function
> =20
> I'd like to like this:
>=20
> return $htmlReport, $res;
>=20
> but get the error: Parse error: syntax error, unexpected ',' in C:\www\te=
st\timeweb\classes\reports.php on line 2745
Yeah, that's not valid PHP. Return it as as array...
return array($htmlReport, $res);
-Stut
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php