Assigning values to a large number of variables in php after an if () -


do know better way thing when comes assigning values large number of variables after if?

in case this:

$aketype = array_key_exists('type',$handle); $akeparent = array_key_exists('parent',$handle); $akeusername = array_key_exists('username',$handle); $akeuserid = array_key_exists('userid',$handle); $akecountrycode = array_key_exists('userid',$handle);  if ( $aketype && $akeparent && $akeusername && $akeuserid & $akecountrycode ) { $listtype   = $handle['type']; $listparent = $handle['parent']; $listusername = $handle['username']; $listuserid = $handle['userid']; $foo = $_post['foo']; $bar = $_post['bar']; $listcountrycode = $handle['countrycode']; // there way clean part? assignments variables. 

take @ extract -- import variables current symbol table array

extract($handle, extr_overwrite, "ake_"); 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -