function tconf() { \config\Conf::$numerorole["test"] = 1; \config\Conf::$numerorole["test2"] = array("Install", "Visiteur", "Normal", "Torrent", "Sysop", "test" => 0.1); var_dump(\model\simple\MakerConf::makeParam(\config\Conf::$numerorole)); var_dump(\config\Conf::$numerorole["test2"]); var_dump(var_export(null, true)); }
static function makeParam($res) { if (is_array($res)) { $res1 = "array("; foreach ($res as $k => $v) { if (is_int($k)) { $res1 .= MakerConf::makeParam($v) . ','; } else { $res1 .= '"' . $k . '"=>' . MakerConf::makeParam($v) . ','; } } $res1 = substr($res1, 0, -1); $res1 .= ")"; return $res1; } if (is_null($res)) { return "null"; } if (is_bool($res)) { return $res ? "true" : "false"; } if (is_string($res)) { return '"' . $res . '"'; } if (is_numeric($res)) { return $res; } }