• Notice regarding image hosts and attachments. See here.

Using a variable as a function name (php)

Associate
Joined
19 Jun 2006
Posts
162
Location
Swansea, Wales
I'm 99% sure this is possible because I think I've done it before but I can't remember how.

I have this line...

Code:
$avrStatArray[$i] = db_getXXXAvr($row["Call-ID"]);

I want to replace 'XXX' with $var

A little help... :D
 
jdickerson said:
Can't you just concant, as per your original:

Code:
$avrStatArray[$i] = 'db_get . $x . Avr' . ($row["Call-ID"]);

Possibly. I didn't try. I need to pass the variable to another function anyway. :cool:
 
Back
Top Bottom