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
VMware, vSphere Virtual Machine and Disk Errors "invalid disk type 7" and "cannot detect guest operating system type"
Cannot boot into Windows 7 partition (Blinking cursor) after using Acronis Disk Director resize
vbscript exit if file exists
How to ensure only one user at a time uses the MS access application?
Problem with autodiscover with Outlook 2007/Exchange 2003
Sharepoint 2010 and default IIS
Enabling bluetooth in Ubuntu 10.04
SSIS Case Statement not executing
Networking a work laptop with a home network
Database Driven Website