Re: [PHP] Mixed PHP/SSI and environment variables

2005-10-29 Thread Richard Lynch
On Thu, October 27, 2005 3:43 am, Christoph Freundl wrote:
 I have a problem with the persistence of environment variables when
 mixing PHP and SSI (Apache) and I am not sure if I just made an error
 or if this approach cannot work at all.
 So please consider the following files:

I *believe* that there are two different scenarios here:

1. Each virtual is a totally separate HTTP request, in the
stateless HTTP protocol, and your environment variables in one will
not (ever) survive to the next.

2. Apache is configured to do virtual requests as some kind of
sub-request and it's all in one single HTTP request/process/thread. 
I *think* this is a feature I've read about in HTTP specification at
http://apache.org

If I'm right about all this, none of this has much to do with PHP
really, and has everything to do with Apache and configuration.  You'd
have the same issues in mod_perl or mod_python as you are having in
PHP.

PS Abondon SSI and just use PHP and your headaches will all disappear.
:-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mixed PHP/SSI and environment variables

2005-10-29 Thread Richard Lynch
On Fri, October 28, 2005 9:36 am, Christoph Freundl wrote:
 Perhaps I return to what I primarily intended to ask: is it really the
 wanted behaviour of virtual() that changes that are made by the
 included file do not influence the environment of the including file?

That is most definitely a desirable behaviour for some users.

/virtual is a separate HTTP requestm just as if the user had surfed
there and crammed in the result.

HTTP is stateless for various reasons.

There are pros and cons to that, but it was not done on a whim.

You MIGHT be able to pass myvar *into* the /virtual as a GET arg...

!-- #virtual /whatever.shtml?myvar=!-- #print myvar 

I'm pretty sure of 2 things:
1. !-- #print myvar -- is probably not how you print out an SSI var.
2. Even if it *IS* how you do it, nesting the !-- # directives ain't
gonna work.

But you get the idea.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Mixed PHP/SSI and environment variables

2005-10-28 Thread Christoph Freundl
Hello,

I have a problem with the persistence of environment variables when 
mixing PHP and SSI (Apache) and I am not sure if I just made an error 
or if this approach cannot work at all.
So please consider the following files:

setvar.shtml
-
!--#set var=myvar value=myval --
-

showvar.php
-
?php echo apache_getenv( myvar ); ?
-

info.shtml
-
!--#include virtual=setvar.shtml --
!--#include virtual=showvar.php --
-

info.php
-
?php
  virtual( setvar.shtml );
  echo apache_getenv( myvar );
?
-

What I would expect is that you get the same result if you call 
info.shtml and info.php. What happens when I tried (PHP 4.3.10 with 
both Apache 1.3.33 and 2.0.53): the shtml shows the variable but the 
php does not, it seems to forget the variable set in setvar.shtml.
Please, can anybody tell me what is going wrong here?

Regards, Christoph

-- 
Christoph Freundlhttp://www10.informatik.uni-erlangen.de/~chfreund/
Lehrstuhl für Systemsimulation (Inf. 10), Cauerstr. 6, D-91058 Erlangen
   The earth is like a tiny grain of sand, only much, much heavier.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mixed PHP/SSI and environment variables

2005-10-28 Thread Jochem Maas

Christoph Freundl wrote:

Hello,

I have a problem with the persistence of environment variables when 
mixing PHP and SSI (Apache) and I am not sure if I just made an error 
or if this approach cannot work at all.

So please consider the following files:

setvar.shtml
-
!--#set var=myvar value=myval --
-

showvar.php
-
?php echo apache_getenv( myvar ); ?
-

info.shtml
-
!--#include virtual=setvar.shtml --
!--#include virtual=showvar.php --
-

info.php
-
?php
  virtual( setvar.shtml );


have yuou tried include/require here instead of virtual()

I imagine that the env of the subprocess wouldn't affect
the env of the parent process - i.e. to me it makes sense
if you say the env var in the subprocess is not available in
the parent process.


  echo apache_getenv( myvar );
?
-

What I would expect is that you get the same result if you call 
info.shtml and info.php. What happens when I tried (PHP 4.3.10 with 
both Apache 1.3.33 and 2.0.53): the shtml shows the variable but the 
php does not, it seems to forget the variable set in setvar.shtml.

Please, can anybody tell me what is going wrong here?

Regards, Christoph



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mixed PHP/SSI and environment variables

2005-10-28 Thread Christoph Freundl
Am Freitag, 28. Oktober 2005 13:22 schrieb Jochem Maas:
  info.php
  -
  ?php
virtual( setvar.shtml );

 have yuou tried include/require here instead of virtual()

 I imagine that the env of the subprocess wouldn't affect
 the env of the parent process - i.e. to me it makes sense
 if you say the env var in the subprocess is not available in
 the parent process.

echo apache_getenv( myvar );
  ?
  -

Nope, both include and require result that the content of setvar.shtml 
shows up literally in the output without the SSI having been processed 
by Apache.

-- 
Christoph Freundlhttp://www10.informatik.uni-erlangen.de/~chfreund/
Lehrstuhl für Systemsimulation (Inf. 10), Cauerstr. 6, D-91058 Erlangen
  Quiet people aren't the only ones who don't say much. - R. Baalke

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mixed PHP/SSI and environment variables

2005-10-28 Thread Jochem Maas

Christoph Freundl wrote:

Am Freitag, 28. Oktober 2005 13:22 schrieb Jochem Maas:


info.php
-
?php
 virtual( setvar.shtml );


have yuou tried include/require here instead of virtual()

I imagine that the env of the subprocess wouldn't affect
the env of the parent process - i.e. to me it makes sense
if you say the env var in the subprocess is not available in
the parent process.



 echo apache_getenv( myvar );
?
-



Nope, both include and require result that the content of setvar.shtml 
shows up literally in the output without the SSI having been processed 
by Apache.



ok, and if you stick the following in 1 file and call it?:

!--#set var=myvar value=myval --
?php echo apache_getenv( myvar ); ?


... just thinking out loud here.





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mixed PHP/SSI and environment variables

2005-10-28 Thread Christoph Freundl
Am Freitag, 28. Oktober 2005 13:42 schrieb Jochem Maas:
 ok, and if you stick the following in 1 file and call it?:

 !--#set var=myvar value=myval --
 ?php echo apache_getenv( myvar ); ?

 ... just thinking out loud here.

Ok, I tried this by configuring Apache such that .php-files are also 
parsed for Server Side Includes and wrote it the way you suggest. Now 
I am really confused: the SSI statements are obviously recognized 
because they do not appear in the resulting file but
a) apache_getenv does still not return the value for the variable but
b) if I call phpinfo() instead of apache_getenv the variable myvar 
plus the set value is shown correctly in the Apache Environment and
c) an SSI !--#echo var=myvar -- after the php block also gives the
correct value

Perhaps I return to what I primarily intended to ask: is it really the 
wanted behaviour of virtual() that changes that are made by the 
included file do not influence the environment of the including file?

Regards, Christoph

-- 
Christoph Freundlhttp://www10.informatik.uni-erlangen.de/~chfreund/
Lehrstuhl für Systemsimulation (Inf. 10), Cauerstr. 6, D-91058 Erlangen
Tel: +49-9131-85-28676 | A low voter turnout is an indication of fewer
Fax: +49-9131-85-28928 |people going to the polls. - D. Quayle

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mixed PHP/SSI and environment variables

2005-10-28 Thread Jochem Maas

Christoph Freundl wrote:

Am Freitag, 28. Oktober 2005 13:42 schrieb Jochem Maas:


ok, and if you stick the following in 1 file and call it?:

!--#set var=myvar value=myval --
?php echo apache_getenv( myvar ); ?

... just thinking out loud here.




I just looked at apache_getenv():

string apache_getenv ( string variable [, bool walk_to_top] )

the second arg maybe something to consider?
also does getenv() [http://php.net/getenv] have the same problems?




Ok, I tried this by configuring Apache such that .php-files are also 
parsed for Server Side Includes and wrote it the way you suggest. Now 
I am really confused: the SSI statements are obviously recognized 
because they do not appear in the resulting file but

a) apache_getenv does still not return the value for the variable but
b) if I call phpinfo() instead of apache_getenv the variable myvar 
plus the set value is shown correctly in the Apache Environment and

c) an SSI !--#echo var=myvar -- after the php block also gives the
correct value

Perhaps I return to what I primarily intended to ask: is it really the 
wanted behaviour of virtual() that changes that are made by the 
included file do not influence the environment of the including file?


I would say yes because virtual() create a sub-process, with it _own_ env.



Regards, Christoph



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Mixed Up Values

2005-04-25 Thread Mark Sargent
Hi All,
with the below code, $myrow[1] should = product_name's value, $myrow[2] 
should = product_model_number's value and $myrow[3] should = 
product_serial_number's value, but, product_name's value is not being 
displayed, and the values are being moved to the left 1. Meaning 
product_model_number is being displayed as product_name and so forth. 
What is wrong with the code.? Cheers.

Mark Sargent.
$result = mysql_query(SELECT product_name, product_model_number,
23 product_serial_number FROM Products,$db);
24
25
26
27 echo table border=1\n;
28
29
30
31 echo trtdProduct Name/tdtdProduct Model 
Number/tdtdProduct
32 Serial Number/td/tr\n;
33
34
35
36 while ($myrow = mysql_fetch_row($result)) {
37
38
39
40 printf(trtd%s/tdtd%s/tdtd%s/td/tr\n,
41 $myrow[1], $myrow[2], $myrow[3]);

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Mixed Up Values

2005-04-25 Thread Matt Harnaga
Mark Sargent wrote:
Hi All,
with the below code, $myrow[1] should = product_name's value, 
$myrow[2] should = product_model_number's value and $myrow[3] should = 
product_serial_number's value, but, product_name's value is not being 
displayed, and the values are being moved to the left 1. Meaning 
product_model_number is being displayed as product_name and so forth. 
What is wrong with the code.? Cheers.

Mark Sargent.
$result = mysql_query(SELECT product_name, product_model_number,
23 product_serial_number FROM Products,$db);
24
25
26
27 echo table border=1\n;
28
29
30
31 echo trtdProduct Name/tdtdProduct Model 
Number/tdtdProduct
32 Serial Number/td/tr\n;
33
34
35
36 while ($myrow = mysql_fetch_row($result)) {
37
38
39
40 printf(trtd%s/tdtd%s/tdtd%s/td/tr\n,
41 $myrow[1], $myrow[2], $myrow[3]);

Change line 41 to $myrow[0], $myrow[1], $myrow[2]);
By default, arrays start from 0 and work their way up, unless you supply 
index names/values yourself.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mixed strings

2004-12-20 Thread Richard Lynch
Ian Firla wrote:
 I'm wondering if anyone knows if there's a way of sending strings of
 mixed type to a UDP socket.

 I'm storing the data I need to send in an array. Parsing the array with
 a foreach, I'm sending out the various pieces to the socket with fwrite.

fwrite converts your input to string.
Check the arg-list at:
http://php.net/fwrite

 Unfortunately, it seems that UDP terminates each message and the client
 is expecting everything in one chunk with each byte of a specific type
 (ie. ASCII, INTEGER, BCD)

 Is there any way I can write a string of mixed types to an open UDP
 socket as a single message?

I doubt it.

Write an encoder/decoder to go from your internal data structure to string
and back.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mixed strings

2004-12-18 Thread Ian Firla

Hi All,

I'm wondering if anyone knows if there's a way of sending strings of
mixed type to a UDP socket.

I'm storing the data I need to send in an array. Parsing the array with
a foreach, I'm sending out the various pieces to the socket with fwrite.

Unfortunately, it seems that UDP terminates each message and the client
is expecting everything in one chunk with each byte of a specific type
(ie. ASCII, INTEGER, BCD)

Is there any way I can write a string of mixed types to an open UDP
socket as a single message?

Ian

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to comment out chunk of html/php mixed code?

2003-09-16 Thread rush
Raditha Dissanayake [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Wrong approach all together. Start using CVS

and do not mix php and html - use templates :)

rush
--
http://www.templatetamer.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] How to comment out chunk of html/php mixed code?

2003-09-15 Thread Wei Wang
hi, 

This may sound very newbie. But since html comment uses !-- -- which doesn't comment 
out the
php code. And the php comment /**/ // apparently doesn't work on html. So how do I 
comment out
a chunk of html/php mixed code? 


Many thanks,

Wei Wang

Re: [PHP] How to comment out chunk of html/php mixed code?

2003-09-15 Thread Robert Cummings
You might try the following:

!-- ?php /*

*/ ? --

This is untested, I've never had to face the issue.

Cheers,
Rob.

On Mon, 2003-09-15 at 15:59, Wei Wang wrote:
 hi, 
 
 This may sound very newbie. But since html comment uses !-- -- which doesn't 
 comment out the
 php code. And the php comment /**/ // apparently doesn't work on html. So how do I 
 comment out
 a chunk of html/php mixed code? 
 
 
 Many thanks,
 
 Wei Wang
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to comment out chunk of html/php mixed code?

2003-09-15 Thread Gabriel Guzman
On Monday 15 September 2003 12:59 pm, Wei Wang wrote:
 hi,

 This may sound very newbie. But since html comment uses !-- -- which
 doesn't comment out the php code. And the php comment /**/ // apparently
 doesn't work on html. So how do I comment out a chunk of html/php mixed
 code?

probably the easiest way is to just do this: 


?php /*

your mixed html and php code here 

*/ ?

that way php will take everything inside the ?php ? tags and comment them 
out, regardless of if they are html or php or whatever. 

hth, 
gabe.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to comment out chunk of html/php mixed code?

2003-09-15 Thread CPT John W. Holmes
From: Wei Wang [EMAIL PROTECTED]

 This may sound very newbie. But since
 html comment uses !-- -- which doesn't
 comment out the php code. And the php
 comment /**/ // apparently doesn't work
 on html. So how do I comment out a
 chunk of html/php mixed code?

/* and */ appears to work:

?php

/*
echo hello world;
?
HTML
?php
*/

echo bye;

?

That'll just display bye... You just have to start the comment in PHP mode
and end it in PHP mode. Any breaking out of PHP mode to display HTML will be
commented out.

If you have mostly HTML with some PHP thrown in that you want to comment
out, HTML comments will work, also, so long as you start the comment in HTML
mode and end it in HTML mode, like this:


HTML
!--
HTML
?php echo hi; ?
HTML
--
HTML

Which will just display HTML twice. The center part is commented out.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to comment out chunk of html/php mixed code?

2003-09-15 Thread Eugene Lee
On Mon, Sep 15, 2003 at 08:59:53PM +0100, Wei Wang wrote:
: 
: This may sound very newbie. But since html comment uses !-- --
: which doesn't comment out the php code. And the php comment /**/ //
: apparently doesn't work on html. So how do I comment out a chunk of
: html/php mixed code? 

Remove the chunk of mixed code and save it into an external PHP file,
e.g. mixed_code.php.  In place of removed chunk, use an include() or
require() statement, e.g. include(mixed_code.php).  Now comment
that one line in or out as needed.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to comment out chunk of html/php mixed code?

2003-09-15 Thread Jennifer Goodie

 ?php /*

 your mixed html and php code here

 */ ?

 that way php will take everything inside the ?php ? tags and
 comment them
 out, regardless of if they are html or php or whatever.

This won't work is your PHP code has comments using /* */ syntax in it
already.  I always just through an if(false){ } around huge portions of
mixed content that I want to comment out.  Unless you have unbalanced curly
braces in the chunk you want to comment out, it should work.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: How to comment out chunk of html/php mixed code?

2003-09-15 Thread Curt Zirzow
On Mon, 15 Sep 2003 20:59:53 +0100, Wei Wang [EMAIL PROTECTED] wrote:

hi,

This may sound very newbie. But since html comment uses !-- -- which 
doesn't comment out the
php code. And the php comment /**/ // apparently doesn't work on html. So 
how do I comment out
a chunk of html/php mixed code?
for temporary comments I do what jennifer does and use a if(false) block to 
not execute it

?php
if(false) {
// other php code
/* that has comments like this */
?html code?php
} // if false
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How to comment out chunk of html/php mixed code?

2003-09-15 Thread Raditha Dissanayake
Wrong approach all together. Start using CVS

Wei Wang wrote:

hi, 

This may sound very newbie. But since html comment uses !-- -- which doesn't 
comment out the
php code. And the php comment /**/ // apparently doesn't work on html. So how do I 
comment out
a chunk of html/php mixed code? 


Many thanks,

Wei Wang
  



-- 
http://www.radinks.com/upload
Drag and Drop File Uploader.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mixed

2002-10-31 Thread Marek Kilimajer

Shaun wrote:


Hi,

In asp there is a session timeout function that allows the session to
end after the session is INACTIVE for x seconds/minutes ! How do i do this
in php ?
 

session_cache_expire(value_in_minutes);
documentation is not very clear about it, but I guess it needs to be set 
before session_start()
can be set also in php.ini using session.cache_expire directive

Is there a way to open a php page in internet expl. without having a
url/adress bar
or a back and forward button , if so how do i go to work?
 

this is javascript
new_win = open(' url ', 'new_win_name', window_features)
you need to set right window features, check out developer.netscape.com 
- client side javascript,
object window, method open

I asked this before, but say for instance - the user is busy on a secure
page , but without logging out he enters another url in the address bar.The
session
of my page , does it end or does the session carry to the next page ? If so
how can
i stop it ?


session are per domain, or if you set path using 
session_set_cookie_params(), even per path. If the
user comes back within time limit, the session is still active


thanks , shaun!



 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] mixed

2002-10-31 Thread John W. Holmes
 In asp there is a session timeout function that allows the session to
 end after the session is INACTIVE for x seconds/minutes ! How do i do
this
 in php ?

You can set the lifetime of the session in php.ini.
session.gc_maxlifetime is the time after which, inactive sessions will
be deleted. session.gc_probability controls the percentage chance that
the garbage collection (session deletion) will be triggered with each
session_start(). You can also set some of the cookie parameters. All the
details are in the manual, give it a try.
http://www.php.net/manual/en/ref.session.php
 
 Is there a way to open a php page in internet expl. without having a
 url/adress bar
 or a back and forward button , if so how do i go to work?

No, use javascript. 

 I asked this before, but say for instance - the user is busy on a
secure
 page , but without logging out he enters another url in the address
 bar.The
 session
 of my page , does it end or does the session carry to the next page ?
If
 so
 how can
 i stop it ?

The session cookie will remain on his computer. It's only good for your
site though. If they return, the session will still be active, unless
it's been they wait over X minutes and the session file on the server is
deleted by the garbage collection.

Remember how HTTP works. All your web server does is process requests.
You can't tell between requests if the user went somewhere else or not. 

---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mixed

2002-10-30 Thread Shaun
Hi,

In asp there is a session timeout function that allows the session to
end after the session is INACTIVE for x seconds/minutes ! How do i do this
in php ?

Is there a way to open a php page in internet expl. without having a
url/adress bar
or a back and forward button , if so how do i go to work?

I asked this before, but say for instance - the user is busy on a secure
page , but without logging out he enters another url in the address bar.The
session
of my page , does it end or does the session carry to the next page ? If so
how can
i stop it ?

thanks , shaun!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mixed type

2002-03-12 Thread max

While looking thru php funcions (mixed ora_getcolumn ( int cursor, mixed
column) in partucular)
I came across type MIXED. What does that mean? There is no such type
mentioned in the php
docs under TYPES section.

thanks.

max.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mixed type

2002-03-12 Thread Lars Torben Wilson

On Tue, 2002-03-12 at 14:33, max wrote:
 While looking thru php funcions (mixed ora_getcolumn ( int cursor, mixed
 column) in partucular)
 I came across type MIXED. What does that mean? There is no such type
 mentioned in the php
 docs under TYPES section.
 
 thanks.
 
 max.

It simply means that more than one type is valid at that point. In the
above example, it means that ora_getcolumn() can return variables of
different types. For instance, on failure, it returns FALSE (Boolean); 
on success, it returns a string or NULL.


Hope this helps,

Torben

-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mixed datatype

2002-01-28 Thread charlesk

How do you make a function like 
bool session_register (mixed name [, mixed ...])

What does the function look like that it can take unlimited arguments?

Charles Killmer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mixed datatype

2002-01-28 Thread Matt Schroebel

http://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list

-Original Message-
From: charlesk [mailto:[EMAIL PROTECTED]] 

What does the function look like that it can take unlimited arguments?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mixed datatype

2002-01-28 Thread Jim Lucas [php]

?
function MyFunc($item, $args=)
{
extract((isset($args)?$args:array()));

return($item, $first_arg$second_arg$third_arg);
}

//call MyFunc()
echo MyFunc(hi there, array(
first_arg = my name ,
second_arg = is ,
third_arg = Jim.,
));

// this will print 
//  hi there, my name is Jim.
?

Hope this helps.

Jim Lucas
- Original Message - 
From: charlesk  [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 28, 2002 8:23 AM
Subject: [PHP] mixed datatype


 How do you make a function like 
 bool session_register (mixed name [, mixed ...])
 
 What does the function look like that it can take unlimited arguments?
 
 Charles Killmer
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]