create a variable name from a string.. php

Faithless

New Member
Generally I pass an array of parameters to my functions.\[code\]function do_something($parameters) {}\[/code\]To access those parameters I have to use: \[code\]$parameters['param1']\[/code\]What I would like to do, is run some sort of logic inside this function on those parameters that converts that array into normal variables. My main reasons is just that sometimes I have to pass a whole load of parameters and having to type $parameters['..'] is a pain.\[code\]foreach($parameters as $key=>$paremeter) { "$key" = $parameter;}\[/code\]I thought that might work.. but no cigar!
 
Back
Top