Why is my code not functioning to delete an element located in my asset.xml
Here is my xml code inside a php file:
<?php
if(isset($_POST["delete"])) {
$node = $_GET["node"]; //get from form
$xmldoc->load('asset.xml');
$y= $xmldoc->getElementsByTagName("asset")[$node];
$xmldoc.documentElement.removeChild($y);}
?>
my xml file
<?xml version="1.0" encoding="UTF-8"?>
<Assets>
<asset>
<AssetType>PROJECTOR</AssetType>
<Product>DELL</Product>
<Brand>DELL</Brand>
</asset>
</Assets>