本文整理汇总了PHP中xml::array2xml方法的典型用法代码示例。如果您正苦于以下问题:PHP xml::array2xml方法的具体用法?PHP xml::array2xml怎么用?PHP xml::array2xml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml
的用法示例。
在下文中一共展示了xml::array2xml方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: implode
}
break;
}
}
if (empty($new_key)) {
echo "3###" . _("Failure: Format not allowed in file") . " " . $editable_files[0] . " (2)";
$error = true;
} else {
$branch = '[' . implode("][", $child['parents']) . '][\'' . $new_key . '\']';
$ok = eval("\$tree_lr{$branch}= \$new_rule;");
}
if ($ok === false && $error == false) {
echo "3###" . _("Failure to update XML File") . " (2)";
$error = true;
} else {
$output = $xml_obj->array2xml($tree_lr);
$output = formatOutput($output, $_level_key_name);
$output = utf8_decode($output);
if (@file_put_contents($path, $output, LOCK_EX) === false) {
$error = true;
echo "3###" . _("Failure to update XML File") . " (3)";
} else {
$result = test_conf();
if ($result !== true) {
$error = true;
echo "4###" . $result;
}
}
}
if ($error == true) {
@unlink($path);
示例2: getChild
} else {
$key = preg_replace("/clone###/", "", $v);
$child_node = getChild($child, $key);
$nodes[$cont - 1][$child_node['node']] = set_new_lk($child_node['tree'], $child_node['tree']['@attributes'][$_level_key_name], $__level_key . "_" . $cont);
}
$cont++;
}
$ok = eval("\$tree{$branch}=\$nodes;");
break;
}
if ($ok === false) {
echo "2###" . _("Failure to update XML File") . " (2)";
$error = true;
} else {
$xml = new xml($_level_key_name);
$output = $xml->array2xml($tree);
$output = formatOutput($output, $_level_key_name);
$output = utf8_decode($output);
if (@file_put_contents($path, $output, LOCK_EX) === false) {
echo "2###" . _("Failure to update XML File") . " (3)";
$error = true;
} else {
$res = getTree($file);
if (!is_array($res)) {
echo $res;
$error = true;
} else {
$tree = $res;
$tree_json = array2json($tree, $path);
$_SESSION['_tree_json'] = $tree_json;
$_SESSION['_tree'] = $tree;
示例3: POST
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301 USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
****************************************************************************/
require_once 'classes/Session.inc';
require_once 'classes/Xml_parser.inc';
require_once '../utils.php';
require_once '../conf/_conf.php';
//Show a rule
$__level_key = POST('key');
$_level_key_name = $_SESSION['_level_key_name'];
$tree_lr = $_SESSION["_tree"];
$child = getChild($tree_lr, $__level_key);
$rule = array("@attributes" => array($_level_key_name => "1"), "0" => array("rule" => $child['tree']));
if (!empty($child)) {
$xml_obj = new xml($_level_key_name);
$output = $xml_obj->array2xml($rule);
echo "1###" . formatOutput($output, $_level_key_name);
} else {
echo "error###" . _("Failure: Information not available");
}