Microsoft
Software
Hardware
Network
Question : PHP: use variable in function name?
Hi All,
Is it possible to use a variable in a function name?
i.e.
$img = 'myimage.png';
$filetype = 'png';
$image = 'imagecreatefrom' . $filetype($img); // should be $image = imagecreatefrompng($filena
me);
Answer : PHP: use variable in function name?
Try like below:
$$ should be used here:
$image = 'imagecreatefrom' . $$filetype($img); // should be $image = imagecreatefrompng($filena
me);
Hope this helps
Addy
Random Solutions
Somebody is sending emials form my hotmail account
How to commit changes of a Typed Dataset to database at once
Dynamic Color
C# 2005 how to Change the Target .NET Framework Version of an Existing Project
Mikrotik Dst-Nat Problem with internal web server
Computer restarted itself twice, event logs attached. Windows 7 Pro
SharePoint File Folder Actions
Binary data
Exchange 2010 EWS Virtual Directory
Changing Default Web Site Properties