Is is possible to change dynamically the array expression of a PHP foreach loop? -


i have few arrays store pages configurations, have same indexes , other similar configurations. name followed config:

$welcomeconfig = array (   "title" => "welcome website",   "other_settings" ); $contactsconfig = array (   "title" => "contact us",   "other_settings" ); 

since don't want hard code every page custom foreach loop wondered if possible define variable, concatenate config string , use array expression.

i tried in way:

$custom = "welcome"; $custom .= "config";  foreach ($custom $config) {   echo $config; } 

but not work.

is there way it?

<?php  $custom = "welcome"; $custom .= "config";  foreach ($$custom $config) {     echo $config; } ?> 

http://php.net/manual/en/language.variables.variable.php


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -