Hello,
> $func = "make_" . $wat;
> $temp = $$func($this);
I think one $.
$func = "make_" . $wat;
$temp = $func($this);
will work
Bas
Op donderdag 31 januari 2002 12:17, schreef u:
> Hoi Bas,
>
> $func = "make_" . $wat;
>
> $temp = $$func($this);
>
> bvr.
>
> On Thu, 31 Jan 2002 11:55:12 +0100
On Thu, 2002-01-31 at 02:55, Bas Jobsen wrote:
> Hello,
>
> > Thanks all. I will rename the second function.
>
> Now if have:
>
> if($wat=="naam")$temp=make_naam($this);
> else if($wat=="anderenaam")$temp=make_anderenaam($this);
> //etc..
>
> But i would prefer something like
> $temp=make_$wat
Hoi Bas,
$func = "make_" . $wat;
$temp = $$func($this);
bvr.
On Thu, 31 Jan 2002 11:55:12 +0100, Bas Jobsen wrote:
>Hello,
>
>> Thanks all. I will rename the second function.
>
>Now if have:
>
>if($wat=="naam")$temp=make_naam($this);
>else if($wat=="anderenaam")$temp=make_anderenaam($this);
Hey Bas,
BV>But i would prefer something like
BV>$temp=make_$wat($this);
I think you might want something along these lines:
eval("make_$wat($this);");
HTH
-jeff
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAI
Hello,
> Thanks all. I will rename the second function.
Now if have:
if($wat=="naam")$temp=make_naam($this);
else if($wat=="anderenaam")$temp=make_anderenaam($this);
//etc..
But i would prefer something like
$temp=make_$wat($this);
How can i do this?
Tnx,
Bas
--
PHP General Mailing List (
Hi,
Thanks all. I will rename the second function.
Bas
--
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]
> include_once() won't help. In fact, he is including each file only once.
> He wants to have a function with the same name in each file. That's the
> kicker...
oh well that's silly, don't do that. also consider function_exists()
regards,
Philip Olson
--
PHP General Mailing List (http://ww
In article ,
[EMAIL PROTECTED] (Philip Olson) wrote:
> > > include("file1");
> > function_somename();
> > include("file2");
> > function_somename();
> > ?>
> >
> > file1 and contain a function definition, but the function in both files had
en
Cc: PHP List
Subject: Re: [PHP] unset a function?
This sounds like a job for include_once
www.php.net/include_once
regards,
Philip Olson
On Wed, 30 Jan 2002, Bas Jobsen wrote:
> Hello,
>
> I have this:
> include("file1");
> function_somename();
>
This sounds like a job for include_once
www.php.net/include_once
regards,
Philip Olson
On Wed, 30 Jan 2002, Bas Jobsen wrote:
> Hello,
>
> I have this:
> include("file1");
> function_somename();
> include("file2");
> function_somename();
> ?>
>
> file1 and contain a function definition, b
Hi,
output:
parse error, expecting `T_VARIABLE' or `'$''
Op woensdag 30 januari 2002 21:51, schreef Rick Emery:
> what happened when you tried unset()?
>
> -Original Message-
> From: Bas Jobsen [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 30, 2002 2:52 PM
> To: PHP List
> S
what happened when you tried unset()?
-Original Message-
From: Bas Jobsen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 30, 2002 2:52 PM
To: PHP List
Subject: [PHP] unset a function?
Hello,
I have this:
file1 and contain a function definition, but the function in both files had
12 matches
Mail list logo